spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: sp-menu does not honor Numpad keys for Arrow ⬆️ ⬇️ and Enter

Open nija1993 opened this issue 2 years ago • 1 comments
trafficstars

Code of conduct

  • [X] I agree to follow this project's code of conduct.

Impacted component(s)

Menu

Expected behavior

Similar to how sp-menu supports navigating across with the help of keyboard arrow keys, it should also support Numpad arrow. Numpad Enter key also should work similar to the main Enter key.

Actual behavior

Numpad keys are not handled at all.

Screenshots

No response

What browsers are you seeing the problem in?

Chrome

How can we reproduce this issue?

  1. Go to storybook menu item page
  2. Click on the first menu item
  3. Using keyboard having numpad, use the ⬆️ ⬇️ keys of the numpad region
  4. Observe the active menu item doesn't change
  5. Press enter key from the numpad section
  6. Notice the menu item is not selected

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response

nija1993 avatar Oct 30 '23 10:10 nija1993

I can see the issue in https://github.com/adobe/spectrum-web-components/blob/main/packages/menu/src/Menu.ts, where instead of using event.code if event.key is used, this would be fixed.

nija1993 avatar Nov 02 '23 07:11 nija1993