From ba4579fa93b72c5583c6e4e5ecfd5b828cacd869 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:29:54 +1000 Subject: [PATCH] Add an explanatory comment describing the current solution as a temporary solution --- .../block-settings-menu/block-settings-dropdown.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js index 9a50b69250afff..bb8e00d0c11db9 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js +++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js @@ -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;