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

deposit-ui (and others): modals should auto-focus their inputs #2455

Closed
4 tasks done
Assignees
Labels
Accessibility enhancement New feature or request good first issue Good for newcomers UI ux Styling/UX issue

Comments

@slint
Copy link
Member

slint commented Sep 26, 2023

When opening modals in the deposit form, their first (or "best" actionable) input should be auto-focused. Some examples:

  • Creators/Contributors "+ Add creator" modal: The focus should be on the search input (i.e. to quickly be able to search for an author, navigate with arrows and click enter to select)
    • Extra: when Tabing through the form, once you reach the "Role" field, it wrongly automatically selects the first option. The only way to clear it afterwards is to click the X at the right of the dropdown
  • Licenses "+ Add custom" modal: Should focus on "Title" input field
  • Awards "+ Add custom" modal: Should focus on "Funder" search dropdown

Some good examples of modals that auto-focus correctly:

  • "Select a community" modal at top of the deposit form (focuses on the search input)
  • Licenses "+ Add standard" modal (focuses on the search input)
  • Awards "+ Add award" modal (focuses on the search input)
  • On the record landing page, all the community management modals on the right sidebar (they focus on their search inputs)
  • Member invitation modal (focuses on the "People" tab inside the modal)
    • 👉 This could be possibly improved by focusing on the member search input directly (but still much better, since you can reach it with a single Tab)
@slint slint added ux Styling/UX issue enhancement New feature or request UI good first issue Good for newcomers labels Sep 26, 2023
@0einstein0 0einstein0 self-assigned this Sep 27, 2023
@jennur
Copy link
Member

jennur commented Sep 29, 2023

Just a comment to the focusing in modals!

Member invitation modal (focuses on the "People" tab inside the modal). This could be possibly improved by focusing on the member search input directly (but still much better, since you can reach it with a single Tab)

The people tab is intentionally focused on opening because it's the first focusable element in the modal. It should be this way because of accessibility concerns (see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/dialog/) – e.g. screen reader users (who can't see the UI) rely on the tab flow, where each focusable element is announced by the screen reader as they navigate.

I.e. from an accessibility perspective:

When opening modals in the deposit form, their first (or "best" actionable) input focusable element should be auto-focused.

@slint
Copy link
Member Author

slint commented Sep 29, 2023

Thanks, that makes sense :)

I think we'll have to see how much the "Organization" option is used and if it's not we could redesign to make the most common path (i.e. "Person") quicker, and move the "Organization" option to something more secondary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility enhancement New feature or request good first issue Good for newcomers UI ux Styling/UX issue
Projects
None yet
3 participants