Skip to content

Pressing delete at the beginning of a block (and NO merge) moves the focus to the wrong block #306

@daniloercoli

Description

@daniloercoli

Pressing delete at the beginning of a block can move the focus to the wrong block when the merge of the 2 blocks cannot happen due to different ("unmergeable") block types.

delete-focus-wrong

To reproduce this issue:

  • Start the demo app
  • Move the cursor at the beginning of the Para block Lorem...
  • Tap delete
  • You will the top "Page Break" block being selected, but the caret is still in the current block and the keyboard up

Note that in GB the standard behavior is to move the focus to the previous block if it's not mergeable. https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/store/effects.js#L165

This is not a problem of the onMerge code, but rather of the focus handling, since i can also replicate this with other steps. Link to the relevant ticket soon to arrive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions