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

enable focussing first element on space activation #2027

Merged
merged 2 commits into from
May 25, 2023

Conversation

keithamus
Copy link
Member

Description

Focus on activation of the action menu can happen in multiple ways, primary keyboard behaviour is via Space or Enter.

Currently we have logic to determine the key-press is happening, and focus the first element in the popover. This only happens on Enter though, which means when Space is pressed, the invoker is still focussed.

This fixes that by checking if any of the Space/Enter activation keys are pressed.

I'd like to eventually remove this code because it should be handled by popover but need to investigate why it isn't.

Integration

Does this change require any updates to code in production?

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews

@keithamus keithamus requested review from a team and camertron May 25, 2023 16:26
@changeset-bot
Copy link

changeset-bot bot commented May 25, 2023

🦋 Changeset detected

Latest commit: 1e55540

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@keithamus keithamus temporarily deployed to preview May 25, 2023 16:26 — with GitHub Actions Inactive
@github-actions github-actions bot added the javascript Pull requests that update Javascript code label May 25, 2023
@keithamus keithamus temporarily deployed to github-pages May 25, 2023 16:31 — with GitHub Actions Inactive
@camertron camertron merged commit f6d9fe9 into main May 25, 2023
@camertron camertron deleted the enable-focussing-first-element-on-space-activation branch May 25, 2023 17:19
@primer-css primer-css mentioned this pull request May 25, 2023
jonrohan pushed a commit that referenced this pull request May 25, 2023
Co-authored-by: Cameron Dutro <camertron@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants