Skip to content

Commit

Permalink
Add an explanatory comment describing the current solution as a tempo…
Browse files Browse the repository at this point in the history
…rary solution
  • Loading branch information
andrewserong committed Sep 13, 2023
1 parent c59e974 commit ba4579f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ export function BlockSettingsDropdown( {

// When a currentClientId is in use, treat the menu as a controlled component.
// This ensures that only one block settings menu is open at a time.
// This is a temporary solution to work around an issue with `onFocusOutside`
// where it does not allow a dropdown to be closed if focus was never within
// the dropdown to begin with. Examples include a user either CMD+Clicking or
// right clicking into an inactive window.
// See: https://github.com/WordPress/gutenberg/pull/54083
const open = ! currentClientId
? undefined
: openedBlockSettingsMenu === currentClientId || false;
Expand Down

0 comments on commit ba4579f

Please sign in to comment.