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

Keyboard navigation allows opening Filter, Sort and Group dropdowns simultaneously #4079

Open
sharath-1517 opened this issue Dec 15, 2024 · 5 comments
Labels
needs: unblocking Blocked by other work type: bug Something isn't working work: frontend Related to frontend code in the mathesar_ui directory

Comments

@sharath-1517
Copy link
Contributor

sharath-1517 commented Dec 15, 2024

Note

This issue is blocked by general accessibility improvements to the dropdowns, including:

Description

On the schemas page, when I tried to navigate the filters through the keyboard using the Tab button I noticed an unusual behavior of all three (Filters, Group, Sort) opening at the same time when I pressed enter key to open the focussed filter. I have attached a screenshot of this behavior. This is completely based on my opinion.

Expected behavior

Only one of the three (Filters, Group, Sort) should open at a time.

To Reproduce

The example in this link can be tried in the popup component.

Environment

  • OS: (eg. macOS 15.1)
  • Browser: (eg. Chrome)
  • Browser Version: (eg. 131.0.6778.109)

Additional context

2-ezgif com-video-to-gif-converter

@sharath-1517 sharath-1517 added needs: triage This issue has not yet been reviewed by a maintainer type: bug Something isn't working labels Dec 15, 2024
@zackkrida zackkrida changed the title Able to open all Filter, Sort and Group together same time Keyboard navigation allows opening Filter, Sort and Group dropdowns simultaneously Dec 17, 2024
@zackkrida zackkrida added work: frontend Related to frontend code in the mathesar_ui directory and removed needs: triage This issue has not yet been reviewed by a maintainer labels Dec 17, 2024
@zackkrida
Copy link
Contributor

It seems that the underlying AttachableDropdown component uses a clickOffBounds action to close the dropdown when clicking outside of it (confirmed in the code below):

use:clickOffBounds={{
callback: close,
references: clickOffBoundsReferences,
}}

However, this action does not handle focus-based events.

A broader issue with dropdowns and keyboard navigation needs to be addressed first. Specifically, when a dropdown is triggered, focus should move to the first focusable child within the dropdown.

Once that is in place, we can add logic to close the dropdown when focus shifts outside of it.

@seancolsen or @pavish can likely confirm or clarify further. Once someone has confirmed my suspicions, I'll go ahead and create any necessary follow-up issues.

Thanks for reporting this @sharath-1517!

@zackkrida zackkrida added the needs: implementation specs We need clarity on HOW we'll implement it from a technical perspective label Dec 17, 2024
@seancolsen
Copy link
Contributor

Similar: #1886

@zackkrida zackkrida added the needs: unblocking Blocked by other work label Dec 17, 2024
@sharath-1517
Copy link
Contributor Author

@zackkrida I am happy to contribute in any way I can to mathesar. It's my pleasure.

@zackkrida zackkrida removed the needs: implementation specs We need clarity on HOW we'll implement it from a technical perspective label Dec 17, 2024
@seancolsen
Copy link
Contributor

@zackkrida

@seancolsen or @pavish can likely confirm or clarify further. Once someone has confirmed my suspicions, I'll go ahead and create any necessary follow-up issues.

Yes, I agree with your assessment here. Focus the first focusable element within the dropdown. Then don't allow focusing outside of it. We should do the same for modals.

@zackkrida
Copy link
Contributor

I've updated this issue to be blocked by #1886 and added more detail to that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: unblocking Blocked by other work type: bug Something isn't working work: frontend Related to frontend code in the mathesar_ui directory
Projects
None yet
Development

No branches or pull requests

3 participants