Skip to content

Commit

Permalink
Fix #5858: Menu align focus with PrimeVue
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 11, 2024
1 parent 318be80 commit ee688f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/lib/menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const Menu = React.memo(
}
};

const onItemMouseMove = (event, key) => {
if (event && props.popup && focusedOptionIndex !== key) {
setFocusedOptionIndex(key);
}
};

const onListFocus = (event) => {
setFocused(true);

Expand Down Expand Up @@ -349,6 +355,7 @@ export const Menu = React.memo(
const contentProps = mergeProps(
{
onClick: (event) => onItemClick(event, item, key),
onMouseMove: (event) => onItemMouseMove(event, key),
className: cx('content')
},
ptm('content')
Expand Down

0 comments on commit ee688f8

Please sign in to comment.