Skip to content

Splitting a block by hitting enter should retain the block ID for the initial block. #23335

Closed

Description

@youknowriad

When splitting a block using "Enter". If we had a block with clientID "a", we end up with two blocks with two new clientIds "b", "c". I think this is not great. Any third party plugin assinging meta data to blocks. Ideally, the original block clientId is retained during the whole lifecycle of an editing session unless the block is explicitely removed. I'd also expect that transforming blocks retains the IDs which it already does properly.

cc @ellatrix for thoughts.

Activity

  1. added
    [Type] Bug
    on Jun 20, 2020
  2. ellatrix commented on Jun 21, 2020

    @ellatrix
    Member

    Sure, we can try to do this. Would you expect the client id to be preserved if the block type changes? In other words, do you expect block type and attributes to change for a given client id? This can sometimes be the case, for example if you split at the start of a heading. You could also argue that in this case the second block should get the client id, or even better, the block should remain unchanged and a new block should be inserted before it.

  3. youknowriad commented on Jun 21, 2020

    @youknowriad
    ContributorAuthor

    I think right now the transforms already retain the clientId when transforming. i don't think there's a magic rule that applies automatically, but a good tradeoff could be to just say the first block retains the id. Unless the first blocks is external (paste)

  4. ZebulanStanphill commented on Feb 24, 2021

    @ZebulanStanphill
    Member

    Did #28505 fix this?

  5. ellatrix commented on Mar 1, 2021

    @ellatrix
    Member

    Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions