Skip to content

Still able to select block when block is set to disabled with useBlockEditingMode #57227

@dernin

Description

@dernin

Description

Bug: When a block is set to disabled using setBlockEditingMode, it stops a user from being able to select that block either directly by clicking on it or by selecting it in the block list view, however we discovered that a user is still able to select the disabled block by clicking in the space directly above the block before the block inserter. useBlockEditingMode does not appear to take this method of selecting blocks in to account (if that is a valid method of selecting blocks).
Related to #52094

Step-by-step reproduction instructions

  1. Add two blocks to a page.
  2. Disable the second block using the setBlockEditingMode method.
  3. Confirm that it is disabled by attempting to select it.
  4. Hover the mouse cursor just above the block so that the blue block inserter line and button appear.
  5. Click anywhere between the second block and the first block except for the blue line and insert button. This must be in the center within the bounds of the blue line, not to the left or right of it.
  6. The second block should now be selected and editable.

Screenshots, screen recording, code snippet

image

Environment info

WordPress 6.4.2.
The Gutenberg plugin is not installed.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Feature] Block APIAPI that allows to express the block paradigm.[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions