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

Remove useMouseIntent in favor of focus-visible #1157

Merged
merged 4 commits into from
Apr 15, 2021
Merged

Conversation

dgreif
Copy link
Member

@dgreif dgreif commented Apr 9, 2021

useMouseIntent was manually watching for keyboard/mouse clicks to determine if focus was triggered by the mouse. There is a new CSS pseudo-class, :focus-visible, which exhibits this exact same behavior. Also pulled in the focus-visible polyfill since browser support isn't complete yet.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@dgreif dgreif requested a review from T-Hugs April 9, 2021 18:04
@changeset-bot
Copy link

changeset-bot bot commented Apr 9, 2021

🦋 Changeset detected

Latest commit: eaf89c2

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

This PR includes changesets to release 1 package
Name Type
@primer/components Major

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

@vercel
Copy link

vercel bot commented Apr 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/BqCatCWg7vQNsDQbkJ64B24oK3ai
✅ Preview: https://primer-components-git-remove-mouse-intent-primer.vercel.app

@@ -65,7 +65,6 @@ export const listItemStyles = css`

// can hover states
@media (hover: hover) {
body:not(.intent-mouse) .SelectMenu-item:focus,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any instances of the .SelectMenu-item class being used. Possible I overlooked it, but I think this can be removed at this point.

src/index.ts Show resolved Hide resolved
Copy link
Contributor

@T-Hugs T-Hugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vercel vercel bot temporarily deployed to Preview April 15, 2021 19:42 Inactive
@dgreif dgreif enabled auto-merge (squash) April 15, 2021 19:42
@colebemis colebemis mentioned this pull request Apr 15, 2021
@vercel vercel bot temporarily deployed to Preview April 15, 2021 22:42 Inactive
@dgreif dgreif merged commit 5f85394 into main Apr 15, 2021
@dgreif dgreif deleted the remove-mouse-intent branch April 15, 2021 22:45
@github-actions github-actions bot mentioned this pull request Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants