Skip to content

Commit

Permalink
subscribe to state instead of calculating zoom out view state when ca…
Browse files Browse the repository at this point in the history
…lculating the anchor
  • Loading branch information
draganescu committed Oct 1, 2024
1 parent 2afea08 commit 5d5b959
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/block-editor/src/components/block-popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 5d5b959

Please sign in to comment.