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 interactions not working on dropdown combobox ⌨️ #271

Open
Tracked by #259
ramiAbdou opened this issue May 27, 2024 · 10 comments
Open
Tracked by #259

Keyboard interactions not working on dropdown combobox ⌨️ #271

ramiAbdou opened this issue May 27, 2024 · 10 comments
Assignees
Labels
Bug 🐞 Something isn't working. Frontend 💅 This requires UI work (ie: React)

Comments

@ramiAbdou
Copy link
Member

ramiAbdou commented May 27, 2024

Description

This has been an issue for quite a while and this affects all dropdown components - we currently don't have accessible dropdowns that support keyboard interactions.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to /resources/add.
  2. Click on the "Tags" input box.
  3. With the dropdown open, try to move up/down with your keyboard.
  4. It doesn't work.

Expected Behavior

A user should be able to navigate with their keyboard.

Additional Context

This will require a working in our underlying ui package, specifically the ComboboxPopover and Dropdown components. I'm interested in what Radix has to offer with their DropdownMenu component, instead of building this in-house.

@ramiAbdou ramiAbdou added Bug 🐞 Something isn't working. Improvement 💨 An improvement upon an existing feature. Frontend 💅 This requires UI work (ie: React) and removed Improvement 💨 An improvement upon an existing feature. labels May 27, 2024
@ayoaru
Copy link
Contributor

ayoaru commented Jun 11, 2024

Was thinking of using a dropdown box for #216 , I could take a look at this if by the time it becomes relevant someone else hasn't picked it up?

@hebronmekuria
Copy link
Contributor

Happy to pick this up too :)

@tomas-salgado
Copy link
Collaborator

You've got it! @hebronmekuria

@hebronmekuria
Copy link
Contributor

Progress: so far, it seems that making the dropdown menu's into Radix components doesn't work because the children props are not the right type (they need to be DropDown.Item). Just wanted to make this update, will wrap up soon.

@hebronmekuria
Copy link
Contributor

hebronmekuria commented Jun 21, 2024

@tomas-salgado I have a question...
To incorporate Radix's dropdown menu, I have made the original dropdown class to return <DropdownMenu.Root> and all the children that come after it in order to render the Dropdown. I also casted all the children of the dropdown to be on type DropdownMenu.Item.
However, I tried to set the trigger button up as a prop to Dropdown class, which wasn't ideal, because that involved making adjustments to all the files in which Dropdown is imported, and passing the trigger buttons as props. However, the trigger still doesn't work, when I click the trigger button, nothing happens.
Here are some of my assumptions:
-The interactions with the combobox-popover is causing this. I understand that the dropdown is nested within in (or vice versa?) and whatever trigger is used is supposed to initiated both items.
-The context provider is clashing with a possible trigger,
I have been stuck on this for two days, so I'm curious as to what you might think is going on as well as your feedback on how I have gone about changing up dropdown.tsx so far. Thanks!

@hebronmekuria
Copy link
Contributor

I haven't made any relevant changes to combobox-popover yet, just trying to figure out what here is triggering the button and why I can't use Radix's DropdownMenu.Trigger properly.

@tomas-salgado
Copy link
Collaborator

@hebronmekuria thanks for the update! I'm going to take a closer look at this tomorrow, but yeah it'd be great if you could put up a PR with what you already have. No worries if there are bugs so far, just put it as a draft PR and we'll work through it!

hebronmekuria pushed a commit to hebronmekuria/oyster that referenced this issue Jun 22, 2024
hebronmekuria pushed a commit to hebronmekuria/oyster that referenced this issue Jun 22, 2024
@hebronmekuria
Copy link
Contributor

hebronmekuria commented Jun 22, 2024

PR is up! I'm not good with frontend, so let me know if I'm completely off base or what tips you have to figuring out the trigger issue!😁 @tomas-salgado

@tomas-salgado
Copy link
Collaborator

Hey @hebronmekuria, sorry for the delay with this. I've been trying to investigate further but I haven't been able to figure out the issue yet (frontend is also not my forte 😅 ). I'll connect with Rami on this when he's back and he should have more insight on how to proceed

@wflore19
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Something isn't working. Frontend 💅 This requires UI work (ie: React)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants