Skip to content

Commit

Permalink
fix(telepopover): shift focus on hover
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Song <theevansong@gmail.com>
  • Loading branch information
ferothefox committed Oct 20, 2024
1 parent 857c092 commit 5456aac
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
:style="index === selectedIndex ? { background: 'var(--color-button-bg)' } : {}"
@click="handleItemClick(option, index)"
@focus="selectedIndex = index"
@mouseover="handleMouseOver(index)"
>
<slot :name="option.id">{{ option.id }}</slot>
</button>
Expand Down Expand Up @@ -225,6 +226,11 @@ const handleItemClick = (option: Option, index: number) => {
selectOption(option);
};
const handleMouseOver = (index: number) => {
selectedIndex.value = index;
menuItemsRef.value[selectedIndex.value].focus();
};
const disableBodyScroll = () => {
document.body.style.overflow = "hidden";
};
Expand Down

0 comments on commit 5456aac

Please sign in to comment.