-
Notifications
You must be signed in to change notification settings - Fork 6
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
Accessibility fixes #3283
Accessibility fixes #3283
Conversation
b05d6df
to
ec1a9d1
Compare
ec1a9d1
to
8159b95
Compare
8159b95
to
3e90a68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, though it doesn't seem to be working in IE11
f56b006
to
69559b5
Compare
Thanks for the review @AshGDS - should be ready for a re-review now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just a couple more things to think about 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
What
This PR fixes a bug where focus is lost on the "Sort by"
select
element after using it to sort search results. This is because the DOM is updated with new elements when a user uses the "Sort by" filter. This includes inserting an entirely new "Sort by"select
element and removing the previousselect
element which had received focus. I have applied a fix which retains the originalselect
element and only updates theoption
elements within, therefore retaining the focus on theselect
element after it's been used.This is achieved by using a regex on the new stringified HTML (
results.sort_options_markup
) that is received whenupdateSortOptions()
is run following the application of filters to extract theoption
elements. The newoption
elements then replace the existingoption
elements in the "Sort by"select
element.Why
Identified as an issue as part of the WCAG audit of GOV.UK - trello card
Visual changes
None.