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

[Menu Item] Allow keyboard navigation to open href link #8135

Closed
3 of 5 tasks
dmbrinkman opened this issue Nov 6, 2023 · 5 comments
Closed
3 of 5 tasks

[Menu Item] Allow keyboard navigation to open href link #8135

dmbrinkman opened this issue Nov 6, 2023 · 5 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. calcite-components-react Issues specific to the @esri/calcite-components-react package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@dmbrinkman
Copy link

Check existing issues

Actual Behavior

Using a keyboard to open a link to a menu item does not open the link specified in href.

To reproduce: See code pen example and repro steps

Expected Behavior

Keyboard navigation opens the linked page.

Notes from Adam Tirella:
I think we just need to add case for when href is populated, do not prevent default on the rendered internal anchor for enter / space.

Reproduction Sample

https://codepen.io/dmbrinkman/pen/qBgRPxp?editors=1000

Reproduction Steps

  1. Run the codepen example
  2. Click on Link using mouse
  3. Page opens in a new tab
  4. Use the keyboard Enter or Space bar to select Link
  5. Page does not open

Reproduction Version

1.10.0

Relevant Info

No response

Regression?

No response

Priority impact

p2 - want for current milestone

Impact

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

@dmbrinkman dmbrinkman added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Nov 6, 2023
@github-actions github-actions bot added calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone calcite-components-react Issues specific to the @esri/calcite-components-react package. labels Nov 6, 2023
@macandcheese macandcheese added a11y Issues related to Accessibility fixes or improvements. p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Nov 8, 2023
@geospatialem geospatialem added estimate - 3 A day or two of work, likely requires updates to tests. 1 - assigned Issues that are assigned to a sprint and a team member. and removed needs triage Planning workflow - pending design/dev review. 0 - new New issues that need assignment. labels Nov 27, 2023
@geospatialem geospatialem added this to the 2023 December Priorities milestone Nov 27, 2023
@macandcheese
Copy link
Contributor

@geospatialem could you confirm the expected a11y behavior here? Both space and enter key should Navigate to the href if populated?

@geospatialem
Copy link
Member

@geospatialem could you confirm the expected a11y behavior here? Both space and enter key should Navigate to the href if populated?

@macandcheese You're spot on - we'd want to support both space and enter - it looks like the a element and role are setup already, so we'd just need to support the same functionality with the keys that's provided with a click event.

@macandcheese
Copy link
Contributor

FYI for verification - After speaking with @geospatialem - this should match other elements that conditionally render button / anchor (button, link, etc.) and only the enter key should open the link, not space.

macandcheese added a commit that referenced this issue Dec 15, 2023
@macandcheese macandcheese added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Dec 15, 2023
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Dec 18, 2023

🍰 Verified locally on 2.1.0-next.10

@DitwanP DitwanP closed this as completed Dec 18, 2023
@DitwanP DitwanP added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. calcite-components-react Issues specific to the @esri/calcite-components-react package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants