Skip to content

Commit

Permalink
Inserter: Don't select the closest block with editing mode set as dis…
Browse files Browse the repository at this point in the history
…abled (#58971)


Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
Co-authored-by: dernin <dernin@git.wordpress.org>
  • Loading branch information
4 people committed Feb 14, 2024
1 parent 73bd804 commit 39b659d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ function InbetweenInsertionPointPopover( {
isInserterShown: insertionPoint?.__unstableWithInserter,
};
}, [] );
const { getBlockEditingMode } = useSelect( blockEditorStore );

const disableMotion = useReducedMotion();

function onClick( event ) {
if ( event.target === ref.current && nextClientId ) {
if (
event.target === ref.current &&
nextClientId &&
getBlockEditingMode( nextClientId ) !== 'disabled'
) {
selectBlock( nextClientId, -1 );
}
}
Expand Down

1 comment on commit 39b659d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 39b659d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7896007303
📝 Reported issues:

Please sign in to comment.