mirror of https://github.com/rancher/dashboard.git
Set dropdownitem focus on mouseenter
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
parent
cea7caf275
commit
98d04e8c10
|
|
@ -69,6 +69,16 @@ const handleActivate = (e: KeyboardEvent) => {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles keydown events to focus the dropdown item.
|
||||
* @param e - The Mouse event.
|
||||
*/
|
||||
const handleMouseEnter = (e: MouseEvent) => {
|
||||
if (e?.target instanceof HTMLElement) {
|
||||
e?.target?.focus();
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -82,6 +92,7 @@ const handleActivate = (e: KeyboardEvent) => {
|
|||
@click.stop="handleClick"
|
||||
@keydown.enter.space="handleActivate"
|
||||
@keydown.up.down.stop="handleKeydown"
|
||||
@mouseenter="handleMouseEnter"
|
||||
>
|
||||
<slot name="default">
|
||||
<!--Empty slot content-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue