react icon indicating copy to clipboard operation
react copied to clipboard

`<ActionList.Item>` doesn't correctly handle keyboard events

Open tmelliottjr opened this issue 1 year ago • 2 comments

Description

<ActionList.Item> does not properly handle keyboard selection events when a modifier key is used.

Currently <ActionList.Item> registers a handler for the onKeyPress event. keypress events are fired when a key -or- key combination produces a character value. This works fine in most cases, but on Windows for example, Alt+Enter does not produce a character value and an event is not emitted.

Additionally, keypress is now considered an obsolete event and is no longer recommended for use.

Separately, on Mac, the key combination Option+Space results in a non-break space character value, which is different than typical Space resulting in the conditional check for ' ' on line 231 to fail.

Steps to reproduce

  1. Create a new GitHub Project
  2. Ensure there is a table view on the project
  3. Click the view's option button and then choose sort by

Mac:

Use the keyboard to select a secondary sort by using Option+Space and notice selection does not get made.

Windows

Use the keyboard to select a secondary sort by using Alt+Enter and notice selection does not get made.

Version

v36.6.0

Browser

Chrome

tmelliottjr avatar Jan 29 '24 20:01 tmelliottjr

Hi there @tmelliottjr! Thanks for taking the time to make the issue 🙏

When going through this during issue triage, we could totally confirm the issue and we added it to our backlog. There isn't an ETA on when this will be picked up so feel free to submit a fix for this or reach out if this is something you'd want to pair on.

Hope this makes sense, let me know if you have any questions!

joshblack avatar Jan 31 '24 19:01 joshblack

@joshblack thanks for the follow up, I'm happy to open a PR for this. :)

tmelliottjr avatar Feb 01 '24 14:02 tmelliottjr

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

github-actions[bot] avatar Aug 05 '24 16:08 github-actions[bot]