Skip to content

Verse: Unable to exit via enter #52773

Description

@annezazu

Initially noted here #50129 (comment). When trying to exit the Verse block, the only way is to use the option to insert after/before or to use the Inserter to insert a new block. This is replicated using 6.3 RC1:

verse.mov

To address this, solutions have been offered #52783 (comment) and #52783 (comment). TLDR: a single return keeps you in the selected block, and a subsequent return exits it. This matches behavior with the List block.

Activity

  1. added
    [Type] Bug
    [Feature] Writing Flow
    [Block] Verse
    on Jul 19, 2023
  2. added
    [Status] In Progress
    on Jul 20, 2023
  3. removed
    [Status] In Progress
    on Jul 24, 2023
  4. Mamaduka commented on Jul 25, 2023

    @Mamaduka
    Member

    FYI, it was decided to revert the changes and mark this as wontfix. See #52783 and #52928.

  5. hanneslsm commented on Jul 25, 2023

    @hanneslsm

    Linking the comments #52783 (comment) and #52783 (comment)

    The verse block should have the same exit behavior as the list block.

  6. Mamaduka commented on Jul 25, 2023

    @Mamaduka
    Member

    Re-opening the issue.

    @annezazu, do you mind updating the description to reflect the suggested solution(s)?

  7. annezazu commented on Jul 25, 2023

    @annezazu
    ContributorAuthor

    Done.

  8. ellatrix commented on Aug 3, 2023

    @ellatrix
    Member

    I've been looking into this issue and tried adding a new RichText prop onSplitBr, which would split when pressing ENTER on a line break. However, I'm not convinced that we should do this. It's super confusing when you have an empty line in a verse, press Enter, and it suddenly splits in two. And what if you want more than one line between text? Imo, this block works as intended.

    Verse is pretty close to how the Preformatted and Code blocks work. Enter creates a soft line break and you can add as many as you like. I also wouldn't expect two Enter pressed to exit a Code block. If exiting is difficult, it means there's a larger problem for all blocks.

  9. annezazu commented on Aug 3, 2023

    @annezazu
    ContributorAuthor

    @WordPress/gutenberg-design keen to get designer thoughts here. In my mind, this makes it incredibly hard to get out of blocks currently (another example #52774 ) and perhaps a wider solution needs to be considered.

  10. 2 remaining items

  11. hanneslsm commented on Aug 3, 2023

    @hanneslsm

    @WordPress/gutenberg-design keen to get designer thoughts here. In my mind, this makes it incredibly hard to get out of blocks currently (another example #52774 ) and perhaps a wider solution needs to be considered.

    You got me by a minute :)
    The column block has the same issue. But since we cannot also change the background or anything else in the column block, it wouldn't make sense for verse. My ideas from the previous post are obsolete.

    There must be another way to indicate that the user is "locked" into a block and cannot exit via enter.

    How about letting a border bottom appear when pressing enter?
    I wish I knew javascript to do an interactive prototype to see if it works. Here is a static image, hope it conveys the idea:
    image

  12. jasmussen commented on Aug 4, 2023

    @jasmussen
    Contributor

    My instinct here is to leverage a similar behavior as the List block. That is, double enter exits it, but the full behavior of backspace restoring the last list item seems important:

    List

    That is, two enters does escape this verse:

    verse

    However, the precise flow would likely be this:

    • Verse line 1, type something, press enter
    • Verse line 2, don't type anything, press enter
    • You escape the verse but are still on line 2, now it's just a paragraph
    • Press backspace, you're back in the verse, but on line 2

    Make sense?

  13. ellatrix commented on Aug 4, 2023

    @ellatrix
    Member

    It sounds to me like you only want Enter to create a paragraph when at a line break at the end of a verse, and not also in the middle of a verse, which is different from list, which also splits in the middle.

    In that case, I think we should slightly modify onSplitAtEnd, to only split on a newline. That will change the behaviour for captions too, but that's fine, It's better to be consistent.

    My only worry is that you can no longer insert two line breaks to have a blank line between texts, which is common is verses, and common in the Preformatted and Code blocks too.

    So maybe we should only split when there are TWO previous line breaks. In that case we'll need a separate onSplitAtEnd. I will make a PR like that so you can test it.

  14. ellatrix commented on Aug 4, 2023

    @ellatrix
    Member

    In other words: it should be triple Enter that exits the block.

  15. jasmussen commented on Aug 4, 2023

    @jasmussen
    Contributor

    Worth a try, especially if two or three can be tweaked in the PR somewhat easily?

  16. added
    [Status] In Progress
    on Aug 4, 2023
  17. ellatrix commented on Aug 4, 2023

    @ellatrix
    Member
  18. removed
    Needs Design Feedback
    on Aug 30, 2023
  19. removed their assignment
    on Aug 30, 2023
  20. removed
    [Status] In Progress
    on Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Block] Verse[Feature] Writing Flow[Type] Bug

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions