what-input icon indicating copy to clipboard operation
what-input copied to clipboard

:focus-visible behavior?

Open FezVrasta opened this issue 6 years ago • 3 comments

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?

FezVrasta avatar Jan 08 '19 10:01 FezVrasta

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.

ten1seven avatar Jan 28 '19 15:01 ten1seven

@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)

phun-ky avatar Aug 27 '21 07:08 phun-ky

@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).

ten1seven avatar Aug 27 '21 15:08 ten1seven