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

User Input Flow has accessibility issues #2851

Closed
tofumatt opened this issue Feb 23, 2021 · 9 comments
Closed

User Input Flow has accessibility issues #2851

tofumatt opened this issue Feb 23, 2021 · 9 comments
Labels
P1 Medium priority Type: Bug Something isn't working
Milestone

Comments

@tofumatt
Copy link
Collaborator

tofumatt commented Feb 23, 2021

Bug Description

The new User Input Flow has several accessibility issues that cause keyboard-only and screenreader users to have, at minimum, difficulty navigating the new flows. Some bits are simply confusing/unexpected but others make it quite hard to navigate as a keyboard-only user.

This issue encompasses several smaller issues all related to improving the baseline accessibility of the User Input flow.

Return/Enter key does not advance form to next question

The enter key, especially in the text field, should advance the question to the next question. But as shown in the screen capture, it currently doesn't.

2021-02-18 16 54 10

Focus is reset/destroyed when "Back" button is used

The "Next" button works fine, but the "Back" button destroys the user's focus context and forces them to tab through their entire browser UI, at least in Chrome.

While resetting focus isn't great, in this case we should do it but re-focus the user onto their answered question after changing the question back one step.

2021-02-18 16 57 16


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The User Input Flow should be navigable and able to be filled out without the use of a pointing device/mouse.
  • Focus should not be stolen/reset unexpectedly; when focus is manually changed it should be expected, related to the last user interaction, and not reset to the first tab-able item on the page.
  • The "Enter"/"Return" key should submit the current answer/advance the user to the next question.
  • The "Other" text input should not be tabbable unless the "Other" radio/checkbox is selected.

Implementation Brief

  • When the "Back" button is activated, change user focus to be .googlesitekit-user-input__question or the first selectable item in the active question. This will allow the user to change focus through the question as-expected. The same should happen with the "Next" button, which I think it does, but this should be confirmed.
  • When "Enter"/"Return" is used in any of the first four questions, it should proceed to the next question (eg fire the "Next" action) if "Next" is allowed.
  • Set a tabIndex="-1" on the "Other" input unless "Other" is selected.
  • On the last question, proceed with the "Next" action if the user has entered three terms and cannot create anymore—eg, pressing enter should proceed with the "next" action in this state:

Screenshot 2021-03-16 at 22 12 23

Test Coverage

  • No test coverage is needed here.

Visual Regression Changes

  • This should not affect VRT.

QA Brief

  • Users should be able to navigate through all the user input screens with only his keyboard.
  • Focus should not be lost when switching back and forth from screens.

Changelog entry

  • Fix User Input Settings flow accessibility issues
@tofumatt tofumatt added Type: Bug Something isn't working P0 High priority labels Feb 23, 2021
@tofumatt tofumatt self-assigned this Feb 23, 2021
@eclarke1 eclarke1 added this to the Sprint 45 milestone Mar 15, 2021
@eclarke1 eclarke1 removed the Next Up label Mar 15, 2021
@tofumatt
Copy link
Collaborator Author

I sometimes forget that radio buttons in general shouldn't actually be separately tabbable. Someone on the team pointed this out to me and I did more checks thinking "nah, seems they should be tabbable". But the intent is that checkboxes are tabbable—radio inputs should not be.

But to that point, the other three issues are valid. We shouldn't allowing tabbing to the "Other" text input if that option isn't selected.

@tofumatt tofumatt removed their assignment Mar 16, 2021
@felixarntz felixarntz self-assigned this Mar 18, 2021
@felixarntz
Copy link
Member

@tofumatt Good additional points you're making here - should they be added to the ACs / IB here or would you rather open a separate issue? Not tabbing through radio buttons and not tabbing to text input if "Other" is not selected makes sense to me.

@felixarntz felixarntz assigned tofumatt and unassigned felixarntz Mar 19, 2021
@tofumatt
Copy link
Collaborator Author

The radio buttons aren't currently tabbable so that's correct—just clarifying that point as earlier I had marked it as a potential problem, but it's not.

I've added the "Other" not being tabbable when "Other" isn't selected to the ACs/IB, so I think this is now good for review again 👍🏻

@tofumatt tofumatt assigned felixarntz and unassigned tofumatt Mar 23, 2021
@eclarke1 eclarke1 removed this from the Sprint 45 milestone Mar 23, 2021
@felixarntz felixarntz added P1 Medium priority and removed P0 High priority labels Mar 24, 2021
@felixarntz
Copy link
Member

IB ✅

@felixarntz felixarntz removed their assignment Mar 24, 2021
@fhollis fhollis modified the milestone: Sprint 46 Mar 25, 2021
@Hazlitte Hazlitte assigned Hazlitte and unassigned Hazlitte Apr 1, 2021
@fhollis fhollis added this to the Sprint 47 milestone Apr 7, 2021
@asvinb asvinb self-assigned this Apr 13, 2021
@asvinb asvinb removed their assignment Apr 15, 2021
@eugene-manuilov eugene-manuilov self-assigned this Apr 16, 2021
@asvinb asvinb assigned eugene-manuilov and unassigned asvinb Apr 21, 2021
@asvinb asvinb assigned eugene-manuilov and tofumatt and unassigned asvinb Apr 22, 2021
@asvinb asvinb assigned eugene-manuilov and unassigned asvinb Apr 26, 2021
@fhollis fhollis modified the milestones: Sprint 47, Sprint 48 Apr 26, 2021
@eugene-manuilov eugene-manuilov removed their assignment Apr 26, 2021
@wpdarren wpdarren self-assigned this Apr 26, 2021
@wpdarren
Copy link
Collaborator

wpdarren commented Apr 27, 2021

QA Update: Clarification with Engineer ⚠️

@tofumatt @asvinb @felixarntz to add to your comments about radio buttons not being tabbable, why not? In my opinion they should be. When the initial page loads wp-admin/admin.php?page=googlesitekit-user-input you are unable to tab to the next answer in the first question. You have no option but to use the mouse if you want to select any answer but the first one. The initial state is that the first answer option is highlighted but when you tab, it jumps down to the Thank you for creating with WordPress. text and then through the WordPress navigation.

Unless I am missing something obvious, based on this, the QAB fails. What are your thoughts?

@asvinb
Copy link
Collaborator

asvinb commented Apr 28, 2021

@wpdarren As per the docs here:

This section describes the keyboard interaction implemented for most radio groups. For the special case of a radio group nested inside a toolbar, use the keyboard interaction described in the following section.

Tab and Shift + Tab: Move focus into and out of the radio group. When focus moves into a radio group :
If a radio button is checked, focus is set on the checked button.
If none of the radio buttons are checked, focus is set on the first radio button in the group.
Space: checks the focused radio button if it is not already checked.
Right Arrow and Down Arrow: move focus to the next radio button in the group, uncheck the previously focused button, and check the newly focused button. If focus is on the last button, focus moves to the first button.
Left Arrow and Up Arrow: move focus to the previous radio button in the group, uncheck the previously focused button, and check the newly focused button. If focus is on the first button, focus moves to the last button.

So currently, the radio group not being tabbable is in line with W3C ARIA best practices.

@wpdarren
Copy link
Collaborator

QA Update: Fail ❌

@asvinb an interesting scenario: if the user selects Other in error, the cursor jumps into the text field as expected. They are then unable to use the arrow keys to move back up the list of options in the question. Pressing tab moves the cursor to the next stop which is the WordPress text at the bottom of the page. Is this easily fixed?

user-input.mp4

@wpdarren wpdarren assigned asvinb and unassigned wpdarren Apr 28, 2021
@asvinb
Copy link
Collaborator

asvinb commented Apr 28, 2021

@wpdarren I think it's perfectly normal. If you click on the "Other" radio button, the focus immediately switches to the input text for the user to type his answer. If the user wants to go back to the radio options, he will use "Shift + Tab" and then use the arrows keys to move up and down. If the user presses "Tab" without entering anything in the "Other" option, the "Next" button remains disabled, thus the focus will be on the next available focusable item, which is the WordPress link at the bottom of the page.
Let me know if am missing anything!

@asvinb asvinb assigned wpdarren and unassigned asvinb Apr 28, 2021
@wpdarren
Copy link
Collaborator

QA Update: Pass ✅

  • Users are able to navigate through all the user input screens with only the keyboard.
  • Focus is not be lost when switching back and forth from screens.

@wpdarren wpdarren removed their assignment Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants