Skip to content

Commit

Permalink
Merge pull request #2968 from contentful/F36-1606-fix
Browse files Browse the repository at this point in the history
fix(menu): don’t focus menu if menu has just been removed
  • Loading branch information
veu authored Jan 7, 2025
2 parents c06e47c + 3be4b76 commit 2d4097b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/seven-mails-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@contentful/f36-menu': patch
---

Don’t focus menu if menu has just been removed
2 changes: 1 addition & 1 deletion packages/components/menu/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function Menu(props: MenuProps) {
}, 0);
} else {
setTimeout(() => {
menuListRef.current.focus({ preventScroll: false });
menuListRef.current?.focus({ preventScroll: false });
}, 0);
}
}
Expand Down

0 comments on commit 2d4097b

Please sign in to comment.