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

fix(action-popover): ensure that opening using the up arrow focuses last focusable element - FE-6793 #7003

Merged

Conversation

DipperTheDan
Copy link
Contributor

Currently, we have a bug whereby when a user presses the up arrow key, the first focusable item in the menu is focused. This appears to be a bug as we have code that specifically handles this behaviour but is overridden elsewhere in the code. This fix ensures that the last focusable item is focused.

fixes #6826

Proposed behaviour

  • Pressing the Up Arrow key should open the menu and focus the last focusable element.
Screen.Recording.2024-10-08.at.09.40.36.mov

Current behaviour

  • Pressing the Up Arrow key opens the menu and focuses the first focusable element.
Screen.Recording.2024-10-08.at.09.42.22.mov

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

N/A

Testing instructions

  • Ensure that the Up Arrow key focuses on the last focusable element in the menu.
  • No other functionality-related regressions regarding keyboard navigation.

@DipperTheDan DipperTheDan force-pushed the FE-6793_action-popover-keyboard-focus-last-element branch 3 times, most recently from 0544ec0 to d9866a7 Compare October 15, 2024 08:56
…ast element in the menu

Currently we have a bug whereby when a user presses the up arrow key, the first focusable item in
the menu is focused. This appears to be a bug as we have code that specifically handles this
behaviour but is overridden elsewhere in the code. This fix ensures that the last focusable item is
focused.

fixes #6826
@DipperTheDan DipperTheDan force-pushed the FE-6793_action-popover-keyboard-focus-last-element branch from 2a02cba to 38aaed9 Compare October 18, 2024 10:08
@DipperTheDan DipperTheDan merged commit 0b3fd25 into master Oct 18, 2024
24 checks passed
@DipperTheDan DipperTheDan deleted the FE-6793_action-popover-keyboard-focus-last-element branch October 18, 2024 10:20
@carbonci
Copy link
Collaborator

🎉 This PR is included in version 143.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

ActionPopover - opening with Up Arrow focuses first element rather than last
6 participants