Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter key does not work in captions #1651

Closed
mchowning opened this issue Dec 4, 2019 · 6 comments
Closed

Enter key does not work in captions #1651

mchowning opened this issue Dec 4, 2019 · 6 comments

Comments

@mchowning
Copy link
Contributor

Describe the bug

Due to a recent change, the enter key stopped working in captions on Android. It used to add new lines within the caption, but now the newline is immediately removed.

To Reproduce

Steps to reproduce the behavior:

  1. Create a caption
  2. Press "Enter"
  3. Observe that the cursor has not moved to a new line or a new block

Expected behavior

It is unclear what the expected behavior should be. Previously, we were allowing the addition of new lines in captions. @hypest has noted, however, that this is inconsistent with the way that the "Enter" key is handled elsewhere (i.e., paragraph blocks) on mobile. For that reason, he has suggested that we may also want to have the enter key move to a new paragraph block from within captions. It should be noted, however, that this would be a change from web, which has the Enter key create new lines within captions but has the enter key create a new paragraph block elsewhere. What do you think is the best way to proceed here @iamthomasbishop ?

Smartphone

Pixel, Android 10, gutenberg-mobile 1.18.0

@iamthomasbishop
Copy link
Contributor

Expected behavior

@mchowning I remember having a discussion about this a while back, and IIRC we stuck close to the web's behavior. I must admit, it's not clear to me which behavior is the expected one for our users but personally, I agree that I usually expect Enter to close the caption and create a new block because more often than not I want to add a quick caption, hit enter, and move along to a new block.

Is there a way to have a single press of enter to create a new line, then a second (from a blank line) break out? Similar to a list? This would be best of both worlds, imo.

At the end of the day, if we could allow the ability to hit Shift + Enter for new lines we'd be golden, although I think we decided to punt on that at a few points in the project. 😞

@hypest
Copy link
Contributor

hypest commented Dec 6, 2019

Past ticket related to the topic: #426

@mkevins
Copy link
Contributor

mkevins commented Dec 17, 2019

I noticed that if I type rapidly enough (typing a bunch of letters and pressing enter lots of times), occasionally I am able to get a newline to "survive". Just noting here in case it helps.

@mchowning
Copy link
Contributor Author

I'm noticing a very similar can't-add-a-newline-with-enter issue with the button block as well. Again, it only happens on Android. I wouldn't be surprised if it had a similar underlying cause. cc: @lukewalczak

@lukewalczak
Copy link
Contributor

@mchowning Actually I've noticed that issue is affecting components which are using RichText with specified tagName="p".

@mchowning
Copy link
Contributor Author

Closed via #2352

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

No branches or pull requests

6 participants