Skip to content

Commit

Permalink
docs(Toolbar (compat)): update "close overflow popover" docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 committed Feb 18, 2025
1 parent ce3972b commit 4a08080
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/compat/src/components/Toolbar/Toolbar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ The overflow popover can be closed programmatically by using the `overflowPopove
const ToolbarComponent = () => {
const overflowPopoverRef = useRef(null);
const handlePopoverClose = () => {
if (overflowPopoverRef.current.isOpen()) {
overflowPopoverRef.current.close();
const overflowPopover = overflowPopoverRef.current;
if (overflowPopover?.open) {
overflowPopover.open = false;
}
};
return (
Expand Down

0 comments on commit 4a08080

Please sign in to comment.