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

WritingFlow should exclude standard input fields #6468

Closed
afercia opened this issue Apr 27, 2018 · 15 comments
Closed

WritingFlow should exclude standard input fields #6468

afercia opened this issue Apr 27, 2018 · 15 comments
Assignees
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@afercia
Copy link
Contributor

afercia commented Apr 27, 2018

In some cases, having WritingFlow kicking in risks to disrupt the standard interaction with standard input fields and moves the caret outside of the field, even it that's not what users would expect.

Consider for example the permalink edit field:

screen shot 2018-04-27 at 16 05 26

when the mini-form opens, it should be possible to use the arrow keys normally, as users are used to. Instead, when the caret is at the end or at the beginning of the field, pressing the right arrow or the left arrow key moves the caret to the following block or to the post title.

In the post permalink, this behavior is more evident because this UI is, in a way, visually "detached" fro the post. What about other input fields, for example in the shortcode, embeds, video, etc. blocks?

screen shot 2018-04-27 at 17 15 55

I'd say the most expected behavior would be trying to emulate the native behavior as much as possible. When pressing left, right, Home, End (and related keys combination e.g. Cmd+Left), the caret should stay within the input field. Being unexpectedly kicked out from the input field is a very confusing experience also for assistive technology users.

In this case, when the caret is within native input fields, I'd propose to use just the Up and Down keys for WritingFlow (doing nothing when modifier keys are used). Would this be an acceptable trade-off?

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Apr 27, 2018
@karmatosed karmatosed added this to Other in Ideas Apr 27, 2018
@rianrietveld
Copy link
Member

I'd propose to use just the Up and Down keys for WritingFlow (doing nothing when modifier keys are used). Would this be an acceptable trade-off?

Seems fair to me.

@anevins12
Copy link
Contributor

I would get rid of the up and down interactions in fields for future proofing, in the case that we might introduce radio fields

@afercia
Copy link
Contributor Author

afercia commented May 23, 2018

@karmatosed is it possible to prioritize this issue and put it somewhere for 5.0 instead of "ideas"? we've discussed it during today's accessibility bug-scrub and agreed it's something pretty important to try to address properly before release.

@karmatosed
Copy link
Member

@afercia absolutely. Would you be able to summarise here why? Just to close the loop from a Slack meeting.

@karmatosed karmatosed removed this from Other in Ideas May 23, 2018
@karmatosed karmatosed added this to the WordPress 5.0 milestone May 23, 2018
@afercia
Copy link
Contributor Author

afercia commented May 24, 2018

Sure. The point is, when the caret is within a standard input field, user (especially keyboard and screen reader users) expects the caret to behave as usual: using the arrow keys (and any combination with Ctrl/Cmd etc.) just moves the caret within the input field. Instead, in Gutenberg the behavior of WritingFlow kicks in and as soon as users use the arrow keys, they're kicked off from the input field.

This is extremely confusing, as users would expect to operate normally within an input field.

@mtias mtias added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Jun 22, 2018
@mtias mtias added the Needs Decision Needs a decision to be actionable or relevant label Jul 19, 2018
@swissspidy
Copy link
Member

It's not only confusing but also super annoying since the permalink form disappears when hitting the arrow key and I lose all modifications I was about to save.

@afercia
Copy link
Contributor Author

afercia commented Aug 7, 2018

Thanks @swissspidy about the permalink UI you may be interested also in #5494 (comment)

@afercia
Copy link
Contributor Author

afercia commented Sep 3, 2018

See also #9583

@afercia
Copy link
Contributor Author

afercia commented Sep 17, 2018

Discussed during today's accessibility bug-scrub: @mtias any progress on this issue, how can we help this issue move on?

@aduth
Copy link
Member

aduth commented Sep 17, 2018

In this case, when the caret is within native input fields, I'd propose to use just the Up and Down keys for WritingFlow (doing nothing when modifier keys are used).

This seems reasonable to me, though for exhaustiveness' sake, it might be worth doing an audit of where we do expect ArrowLeft & ArrowRight to navigate between blocks (at least Paragraphs), the types of elements they use, and whether they'll always fall under this definition.

I expect this would include <input> and <textarea>, but exclude elements with contenteditable attributes?

@aduth aduth self-assigned this Sep 17, 2018
@aduth
Copy link
Member

aduth commented Sep 17, 2018

I expect this would include <input> and <textarea>, but exclude elements with contenteditable attributes?

Which naturally leads to exceptions: Do we (and what if a developer wants to) use an input element in cases where we'd expect ArrowLeft and ArrowRight to continue writing flow? Conversely, do we have blocks where we use contenteditable for elements which assume the behavior of a standard input? I think it'd be perfectly fine to say that these use-cases would be unsupported / discouraged, more to highlight expected conflicts with varying behavior by the element type.

Another option is to make the ArrowLeft & ArrowRight behavior specific to the RichText element.

@afercia
Copy link
Contributor Author

afercia commented Sep 17, 2018

I expect this would include and <textarea>, but exclude elements with contenteditable attributes?

That would be the idea.

Another option is to make the ArrowLeft & ArrowRight behavior specific to the RichText element.

Hm I guess it would be simpler perhaps, but what when an user tabs away from a native input field and lands, say, on a button? Should WritingFlow work on a button? To clarify visually, see the screenshot below: when tabbing away from the input field, should arrowing on one of the buttons bring me to the paragraph below? Note: for screen reader users, that would be highly unexpected.

screen shot 2018-09-17 at 18 42 17

@aduth
Copy link
Member

aduth commented Sep 17, 2018

Another option is to make the ArrowLeft & ArrowRight behavior specific to the RichText element.

Hm I guess it would be simpler perhaps, but what when an user tabs away from a native input field and lands, say, on a button?

In the original comment, I meant in terms of handling ArrowLeft & ArrowRight only while within the RichText (the source of the interaction, not the destination). But now that you mention it, destination could be a factor as well, since would it be expected that in your example above, if we press ArrowLeft from the beginning of the paragraph, we hit one of the fields within the Video block (the text field even)?

@aduth
Copy link
Member

aduth commented Sep 17, 2018

Pull request at #9978

@afercia
Copy link
Contributor Author

afercia commented Sep 18, 2018

would it be expected that in your example above, if we press ArrowLeft from the beginning of the paragraph, we hit one of the fields within the Video block (the text field even)?

WritingFlow clashes with the way screen readers use arrow keys. When using a screen reader:

  • with Safari+Voiceover: Control-Option-Right arrow or Control-Option-Left arrow
  • screen readers on Windows: Down arrow or Up arrow

these keys are used to navigate content, that means all content not just focusable elements. They're used a lot by users, and it's basically the main way to navigate content sequentially.
Additionally, on Windows screen reader use brose mode or focus mode. In browse mode, arrows navigate content. In focus mode, within a form control, they stop navigating content and behave natively to allow native interaction with form controls.

So back to the example:

press ArrowLeft from the beginning of the paragraph, we hit one of the fields within the Video block (the text field even)

  • in browse mode it would be unexpected because it should just navigate to the previous content, whatever it is (text, button, etc.)
  • in forms mode it would be unexpected as well, because arrow keys within a form field should behave natively, i.e. move the caret in the input field and stay within the input field

@designsimply designsimply removed the Needs Decision Needs a decision to be actionable or relevant label Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

No branches or pull requests

8 participants