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

[BUG] Keyboard input on InputChip misbehaving #985

Closed
jameslounds opened this issue Feb 19, 2023 · 1 comment · Fixed by #987
Closed

[BUG] Keyboard input on InputChip misbehaving #985

jameslounds opened this issue Feb 19, 2023 · 1 comment · Fixed by #987
Labels
bug Something isn't working

Comments

@jameslounds
Copy link

jameslounds commented Feb 19, 2023

Current Behavior

At the moment, the hidden select is focusable from the keyboard.

This leads to unexpected behaviours as select elements do have keyboard inputs, but they don't seem to work cross-browser.

Steps To Reproduce

  1. Go to the InputChip docs page
  2. Use inspect element to remove the h-0 overflow-hidden classes from the select element (helps to visually see what's going on)
  3. Enter some items into the input chip, then shift + tab to focus the select
  4. Use Arrow Keys, Control + Arrow Keys to navigate through select to see unintended behaviour

Anything else?

It would be useful to have some way to focus and remove chips using the keyboard.
Perhaps buttons instead of clickable spans would be better for the chips?

@jameslounds jameslounds added the bug Something isn't working label Feb 19, 2023
@jameslounds
Copy link
Author

Having played around a little with the source code, it does seem to be as simple as just renaming the span to a button, adding some focus classes, and setting the tabindex on the select.

I could have.a PR ready basically whenever, but I'm not sure the best way to implement the focus styles - should they be in the same prop as the other chip styles? Should it be its own prop? Or perhaps on the tailwind side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant