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

XWIKI-18007: Drawer menu improvements for accessibility #2075

Closed
wants to merge 1 commit into from

Conversation

wthrajat
Copy link
Contributor

@wthrajat wthrajat commented Feb 4, 2023

This PR partly fix the issue https://jira.xwiki.org/browse/XWIKI-18007
The drawer menu can now be closed by pressing the ESC key (this works for both the cases, 1) if you opened the drawer using keyboard 2) if you opened the drawer by clicking on it)

Earlier there was no such option to close the drawer menu through keyboard.

Comment on lines 206 to 212
// Drawer can be closed by pressing the ESC key, regardless of how it was opened, whether by keyboard or clicking.
$(document).on('keydown', function (event) {
if (event.key === 'Escape') {
$('.drawer-nav')
.closest('body')
.drawer('close');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should limit javascript.vm for JavaScript code that needs to be executed very early. The rest of the JavaScript code should be put in dedicated JavaScript files. In this case I'd move the entire RequireJS block that handles the drawer to flamingo.js.

Moved the code responsible for drawer to the flamingo.js file
Fixed formatting
@michitux
Copy link
Contributor

This PR doesn't fix the mentioned Jira issue but only a small part of it. Missing parts from what I can see are:

  • The content of the drawer can be focused while the drawer is closed (without the focused items being visible).
  • While the drawer is open, items outside the drawer can be focused.

It is fine to just fix closing the drawer, but I think for this, a new Jira issue should be created that can be closed after this has been merged while the original issue should stay open until everything has been fixed.

@surli
Copy link
Member

surli commented Jan 18, 2024

Closing as the work as been done in #2225

@surli surli closed this Jan 18, 2024
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.

5 participants