Skip to content

Commit 4f0549c

Browse files
committed
fix: pass restoreFocus prop to useMenu
1 parent ad2e4ab commit 4f0549c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/dropdowns/src/elements/menu/Menu.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const Menu = forwardRef<HTMLUListElement, IMenuProps>(
3232
defaultFocusedValue,
3333
defaultExpanded,
3434
isExpanded: _isExpanded,
35+
restoreFocus,
3536
selectedItems,
3637
onChange,
3738
onMouseLeave,
@@ -61,6 +62,7 @@ export const Menu = forwardRef<HTMLUListElement, IMenuProps>(
6162
focusedValue: _focusedValue,
6263
defaultExpanded,
6364
isExpanded: _isExpanded,
65+
restoreFocus,
6466
selectedItems,
6567
items,
6668
menuRef,

packages/dropdowns/src/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ export interface IMenuProps extends HTMLAttributes<HTMLUListElement> {
269269
* @param {string | null} [changes.focusedValue] The updated focused value
270270
*/
271271
onChange?: IUseMenuProps['onChange'];
272+
/** Returns keyboard focus to the element that triggered the menu */
273+
restoreFocus?: IUseMenuProps['restoreFocus'];
272274
/** Sets the selected items in a controlled menu */
273275
selectedItems?: IUseMenuProps['selectedItems'];
274276
/** Adjusts the placement of the menu */

0 commit comments

Comments
 (0)