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

:focus-visible behavior? #90

Open
FezVrasta opened this issue Jan 8, 2019 · 3 comments
Open

:focus-visible behavior? #90

FezVrasta opened this issue Jan 8, 2019 · 3 comments

Comments

@FezVrasta
Copy link

The :focus-visible selector matches almost every time the [data-whatinput=keyboard] is active, but even when the user clicks on an input element with the mouse.

Is there any way to mimic this behavior with what-input?

@ten1seven
Copy link
Owner

Hi @FezVrasta, thanks for bringing this up. I've had :focus-visible on my radar for a while to look into. What Input has been around longer than :focus-visible so it's not meant as a polyfill, but I'm interested in looking into the differences in behavior and seeing if there are any opportunities to make them behave similarly.

@phun-ky
Copy link

phun-ky commented Aug 27, 2021

@ten1seven with that beeing said, is there a need for whatinput when we have :focus-visible ? (if we only use what-input to display focus ring for keyboard users)

@ten1seven
Copy link
Owner

@phun-ky it's very possible! If :focus-visible gets you what you need then I'd agree that jumping on the browser-native solution is the way to go. I don't make any money from what-input so I have no incentive to persuade anyone to use it if they don't need to 😄

Currently, I continue to use it because Safari still doesn't support :focus-visible, and I want a little more control over focus styles than what :focus-visible is providing. Hopping over to MDN's docs, clicking and tabbing through their basic example produces what I'd want for the buttons, but the mouse click response on the text input is the .focus-visible-only style that I'd normally want to treat differently (at least in my work).

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

No branches or pull requests

3 participants