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 authored and youknowriad committed Feb 20, 2024
1 parent 9922ae0 commit 9a1aacb
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

0 comments on commit 9a1aacb

Please sign in to comment.