-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Prevent showing the dropdown menu when changing orientation of mobile devices #12858
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probot-autolabeler
bot
added
the
javascript
Pull requests that update Javascript code
label
May 22, 2024
We need to disable focus in the children element of the hidden menu. If not, we have an AXE error: > aria-hidden-focus: ARIA hidden element must not be focusable or contain focusable elements
andreslucena
force-pushed
the
fix/dropdown-menus-orientation-change
branch
from
May 22, 2024 13:37
524323e
to
5b799a8
Compare
alecslupu
approved these changes
May 27, 2024
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.
👍
This was referenced May 28, 2024
Adding the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
javascript
Pull requests that update Javascript code
module: accountability
module: admin
module: conferences
module: core
no-backport
Pull Requests that should not be backported
type: fix
PRs that implement a fix for a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
This PR fixes multiple bugs with the dropdowns and mobile devices.
In pages with these dropdowns, when the devise changes orientation from landscape (horizontal) to landscape and the dropdown appears, there are two things that happen:
If you refresh, this makes the dropdown to work again.
This can also be reproduced in a desktop by resizing the window and seeing the dropdown appear.
Another related bug to this is that in mobile devices we see a FUOC (flash of unstyled content) while loading pages with these dropdowns.
This PR fixes all of these bugs in the dropdowns that I could found.
At the technical level, for the moment I'm leaving the buggy
data-disabled-md
attribute, as it's still being used in System dashboard. The markup is that bad there that I couldn't find an easy way of fixing this bug, so we can tackle that problem in another PR (and drop the unnecessarydata-disabled-md
attr)I also fixed a mini bug in the "Filter and Search" button title for components, so it has the correct capitalization for English ("Filter and search")
Finally I had to adapt the Javascript code that kicks in the Dropdowns, as there was an accessibility problem: if you have an element with
attr-hidden=true
and this element has children that could be focused, then we have an a11y validation (AXE) to fail (aria-hidden-focus). I fixed it by disabling focus when the dropdown is hidden (and enabling it again once it is open).📌 Related Issues
Testing
Respecting the order of the files shown in GitHub to ease-up the review:
📷 Screenshots
Accountability results index
Assembly admin page (or any admin page with a sidebar)
Conferences show page
Participatory process page (or any other participatory space)
Last activity page
Page in a topic
Search page
Proposal index (or any other component)
My account page