Skip to content

Commit

Permalink
Properly pass menu target to submenu items (microsoft#21162)
Browse files Browse the repository at this point in the history
* Properly pass menu target to submenu items

* Change files
  • Loading branch information
ThomasMichon authored and Marion Le Pontois committed Jan 17, 2022
1 parent a85c535 commit b43da1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Properly pass menu target to submenu items",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function useSubMenuState(

if (item) {
submenuProps = {
items: getSubmenuItems(item)!,
items: getSubmenuItems(item, { target: menuTarget })!,
target: submenuTarget,
onDismiss: onSubMenuDismiss,
isSubMenu: true,
Expand Down Expand Up @@ -619,7 +619,7 @@ function useMouseHandlers(
ev: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,
target: HTMLElement,
): void => {
const items = getSubmenuItems(item);
const items = getSubmenuItems(item, { target: menuTarget });

// Cancel an async menu item hover timeout action from being taken and instead
// just trigger the click event instead.
Expand Down

0 comments on commit b43da1f

Please sign in to comment.