Skip to content

Replaces empty selected text blocks when inserting new blocks  #5054

@notnownikki

Description

@notnownikki

Issue Overview

If I have my cursor in an empty paragraph block, and I use the inserter to insert a new heading or paragraph block, it transforms the block into a heading, or does nothing. But, if I have my cursor in an empty heading block and use the inserter to insert a new paragraph or heading, a new one is inserted, every time. In both cases, the title of the inserter is "add block", but it does different things.

Apparently there is some philosophical discussion about "is an empty block a block"? But from a UI perspective, an empty block looks like a block and behaves like a block, but the inserter changes behaviour, and there's no hint about what behaviour it's going to do.

Steps to Reproduce (for bugs)

  1. Have an empty paragraph block
  2. "Insert" a heading. Heading will replace the block.
  3. Have an empty heading block.
  4. Insert a heading. Heading will actually be inserted.

Expected Behavior

The inserter's behaviour should be consistent. Even if we're saying "empty blocks get transformed", it should consistently do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] InserterThe main way to insert blocks using the + button in the editing interface[Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled later[Type] EnhancementA suggestion for improvement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions