react icon indicating copy to clipboard operation
react copied to clipboard

Key press event listeners should work with `ActionList`

Open reneexeener opened this issue 3 years ago • 6 comments

Describe the bug Key press event listeners for interacting with action list are not invoked when an element is in focus. This issue was first posted in the primer-react channel (link), opening an issue here for better tracking and visibility.

To Reproduce Steps to reproduce the behavior with the current ActionList component:

  1. Check out onto commit ff7e364 in the memex repo and run npm start
  2. Click on the '+' icon in the omnibar at the bottom of the page
  3. Select 'Add item from repository' to open the side panel
  4. Try navigating the list with arrow keys as well as j/k
  5. Tab once
  6. Press j/k/arrow up/arrow down will have no effect
  7. Click somewhere to blur the focused element
  8. Press j/k/arrow up/arrow down navigates the list

Steps to reproduce the behavior with the new ActionList component:

  1. Check out onto commit e7e437b6d8 in the memex repo
  2. Run npm install @primer/react@[local-version] (the most recent local version as of now is 0.0.0-202252993854) and then npm start
  3. Click on the '+' icon in the omnibar at the bottom of the page
  4. Select 'Add item from repository' to open the side panel
  5. Press j to start navigating the list (the indexing is not completely correct because we only added the single-key shortcuts here for making debugging this issue easier)
  6. Press j/k again will have no effect
  7. Click outside the list to blur the focused list item
  8. Press j again navigates to the next item in the list

Expected behavior Key press event listeners inside an ActionList should be invoked even if an element is in focus.

Desktop (please complete the following information):

  • OS: macOS Monterey 12.4
  • Browser: Chrome (103.0.5060.53), Safari(15.5), Firefox (102.0.1)

Additional context Other keyboard shortcuts that are affected are x for selecting/unselecting the checkbox and cmd+Enter for submitting.

Following the recent updates on PR https://github.com/primer/react/pull/2152, we decided to revert our work (https://github.com/github/memex/pull/10707) to make use of the current ActionList component without adding any custom keyboard shortcuts, and therefore only commits are provided for debugging. However we thought opening an issue for this event listener problem might be helpful for future work.

cc @siddharthkp

reneexeener avatar Jul 15 '22 12:07 reneexeener

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 Jan 21 '23 16:01 github-actions[bot]

Not stale

lesliecdubs avatar Jan 25 '23 05:01 lesliecdubs

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 Oct 08 '23 16:10 github-actions[bot]

not stale

siddharthkp avatar Nov 01 '23 14:11 siddharthkp

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 Apr 29 '24 15:04 github-actions[bot]

not stale :)

siddharthkp avatar May 06 '24 16:05 siddharthkp

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 Nov 02 '24 17:11 github-actions[bot]