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

exposing onFocus & onBlur events #90

Open
billwatson017 opened this issue Jan 26, 2021 · 2 comments
Open

exposing onFocus & onBlur events #90

billwatson017 opened this issue Jan 26, 2021 · 2 comments

Comments

@billwatson017
Copy link

billwatson017 commented Jan 26, 2021

We are using this component for a form field implementation and would like to change the style of our wrapper component when a user tabs to this input field. Can you please expose onFocus and onBlur events so we have the ability to toggle our setFocused event?

@mansin-paf
Copy link

Trying to do something similar.
They're currently exposing a property activeBoxShadow, although it doesn't work the way it's intended.
The problem is that whenever you're tabbing to a react-switch element, the hidden input element gets focused leading to the activeBoxShadow never getting applied (because it's expecting the outer wrapper to be focused)

@doubleforte
Copy link

Similar issue for me.

I'm able to style the parent with :focus-within but I only want that when they tab to the switch. CSS can look at :focus-visible on the hidden checkbox, but I can't figure out a way to have the parent wrapper react to the :focus-visible state of the child.

Any ideas?

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