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

Navigation Block: Enter key shouldn't add line break in menu item #18208

Closed
mcsf opened this issue Oct 31, 2019 · 8 comments · Fixed by #21764
Closed

Navigation Block: Enter key shouldn't add line break in menu item #18208

mcsf opened this issue Oct 31, 2019 · 8 comments · Fixed by #21764
Assignees
Labels
[Block] Navigation Affects the Navigation Block Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mcsf
Copy link
Contributor

mcsf commented Oct 31, 2019

Describe the issue
This is both a bug report and an enhancement request.

  1. When the caret is inside a menu item, I had expected that pressing Enter would:
  • Add a new menu item in the same level as the item I was editing.
  • or at the very least add a subitem whose parent is the item I was editing.
  1. In any case, defaulting to breaking the line feels like experiencing an unhandled case.

To reproduce
Steps to reproduce the behavior:

  1. Start a new post.
  2. Add a Navigation block.
  3. Add the first menu item, input some text
  4. Press Enter

Observed
We remain in the same menu item, but now this item's text contains a line break.

Expected behavior
That's up to us to decide.

@mcsf mcsf added [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Block] Navigation Affects the Navigation Block labels Oct 31, 2019
@mcsf
Copy link
Contributor Author

mcsf commented Nov 8, 2019

Added to the Navigation block project for visibility, but please move it out or close if deemed unimportant.

@karmatosed
Copy link
Member

For now, going to mark this as needs design feedback. It certainly does need thinking but not sure a design needs creating yet.

@karmatosed karmatosed added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Dec 11, 2019
@mapk
Copy link
Contributor

mapk commented Jan 8, 2020

I experienced this over here: #18353 (comment) and it felt really odd. I expected different results when hitting Enter similar to @mcsf.

@karmatosed
Copy link
Member

Removing design feedback label as I think we have it.

@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Jan 20, 2020
@mapk
Copy link
Contributor

mapk commented Mar 7, 2020

I'm still experiencing this. Can we get some development on it?

nav

@mapk mapk added the Needs Dev Ready for, and needs developer efforts label Mar 7, 2020
@talldan
Copy link
Contributor

talldan commented Mar 19, 2020

@mcsf @mapk Would be good to clarify the desired behaviour so that we can see if it fits into the current behaviour that RichText supports (onReplace, onSplit, onDelete etc).

I think there are two options:

  • Hitting Enter when the caret is in the middle of a range of text does nothing. Hitting enter when the caret is at the start or end of the range adds a new nav link before or after.
  • The RichText behaves much like the paragraph block. Hitting Enter when the caret is in the middle of a range splits the nav link into two links and Delete merges them back together

I think the first option seems reasonable, but it might require some modifications to how RichText handles onSplit or possibly something related to the multiline prop, which I always found a little confusingly named.

The second option seems unusual in this context, I don't really see a use case for splitting a link in two. The closest block to this one seems like the Buttons block, which is also basically a set of links. Does it seem like this behavior should also exist there?

@noisysocks
Copy link
Member

What do you think @karmatosed?

@noisysocks noisysocks added the Needs Design Feedback Needs general design feedback. label Apr 1, 2020
@noisysocks noisysocks removed [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Enhancement A suggestion for improvement. labels Apr 1, 2020
@karmatosed
Copy link
Member

Hitting Enter when the caret is in the middle of a range of text does nothing. Hitting enter when the caret is at the start or end of the range adds a new nav link before or after.

This one I 'think' feels right. I'm wondering if we are limiting a user case for having it work just like a paragraph? That's my only concern with limiting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants