Skip to content

Insert link: double Enter removes a link because the link text is automatically highlighted after a link is added #7980

@hedgefield

Description

@hedgefield

Describe the bug
Pressing Enter twice when adding a link to text makes the linked text disappear and adds a new block.

To Reproduce

  1. Start a new post in Gutenberg
  2. Write something random in a paragraph block
  3. Select part of that text and click the Link button in the toolbar
  4. Enter some link in the field
  5. Press Enter - the link is 'confirmed'
  6. Press Enter again - the linked text disappears, and anything that came after it is pushed into a new block.
  7. Pressing CTRL-Z then puts back the linked text, but duplicates what came after, and doesn't remove the new block.

Expected behavior
I'm not entirely sure, I think I would prefer pressing Enter just once to confirm the link and then close the popover with the edit button. At least to be able to press Escape to close that popover. At the least for the second Enter to close the popover and do nothing else.

Screenshots
jul-16-2018 16-31-41

Gutenberg 3.2
Chrome 67.0.3396.99
MacOS 10.13.5

Metadata

Metadata

Assignees

No one assigned

    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