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

Change disabling method to avoid losing focus on facets #3209

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Dec 15, 2022

Description of the Change

When facets are used in Instant Results the facet option checkboxes are disabled during loading to avoid a situation where the user selects two mutually incompatible options. This was being done using the disabled attribute, but the problem was that when this attribute was applied the checkboxes lost focus, meaning that keyboard users would lose their position.

This PR changes the checkbox to instead use aria-disabled for indicating the disabled status and to check the disabled status inside the onChange callback. This still prevents the user selecting mutually incompatible filters, but without losing keyboard focus on the checkbox,

Closes #3201

How to test the Change

  1. Perform an Instant Results search.
  2. Navigate to a facet checkbox with the keyboard and make a selection with Space.
  3. After the new results are loaded attempt to navigate to the next or previous facet option. You should navigate to the expected element.
  4. Attempt to quickly select two filter options. Once loading has started after selecting the first option it should not be possible to select another option until loading has finished.

Changelog Entry

Fixed - An issue where keyboard focus on a facet option was lost upon selection.

Credits

Props @JakePT

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT self-assigned this Dec 15, 2022
@JakePT JakePT changed the title Change disabling method to avoid losing focus. Change disabling method to avoid losing focus on facets Dec 15, 2022
@felipeelia felipeelia added this to the 4.4.1 milestone Dec 16, 2022
@felipeelia felipeelia merged commit 788e0f1 into develop Dec 16, 2022
@felipeelia felipeelia deleted the fix/3201 branch December 16, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Facet options do not receive focus after selection
2 participants