Skip to content

Commit

Permalink
Add inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Dec 15, 2022
1 parent fa6ce11 commit b7de65a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/block-popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ function BlockPopover(
};
}, [ selectedElement ] );

// Get the scrollable container that the block popover appears within.
const scrollContainer = useMemo( () => {
if ( ! __unstableContentRef?.current ) {
return;
}
return getScrollContainer( __unstableContentRef?.current );
}, [ __unstableContentRef?.current ] );

// Force the block popover to re-render whenever the content area is scrolled.
// This ensures that the position of the popover is accurate for fixed or sticky blocks.
useLayoutEffect( () => {
if ( ! scrollContainer ) {
return;
Expand Down

0 comments on commit b7de65a

Please sign in to comment.