From f85357cc84a64b43b6de084366b8dad4f7b19a26 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Tue, 1 Oct 2024 10:42:35 +0300 Subject: [PATCH] subscribe to state instead of calculating zoom out view state when calculating the anchor --- .../block-editor/src/components/block-popover/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/block-popover/index.js b/packages/block-editor/src/components/block-popover/index.js index 9d23c0b2ff3499..45a2b3aa970043 100644 --- a/packages/block-editor/src/components/block-popover/index.js +++ b/packages/block-editor/src/components/block-popover/index.js @@ -77,8 +77,12 @@ function BlockPopover( }; }, [ selectedElement ] ); - const { isZoomOut: isZoomOutFn } = unlock( useSelect( blockEditorStore ) ); - const isZoomOut = isZoomOutFn(); + const { isZoomOut } = useSelect( + ( select ) => ( { + isZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(), + } ), + [] + ); const popoverAnchor = useMemo( () => { if (