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

Toggle Switch Disable property is not working as expected #29

Open
Tichandr opened this issue Jul 16, 2020 · 6 comments
Open

Toggle Switch Disable property is not working as expected #29

Tichandr opened this issue Jul 16, 2020 · 6 comments

Comments

@Tichandr
Copy link

I am facing an issue in enabling/disabling the toggle button.

Initial state I have set the property of disabled = {true}, this is working fine. But I wanted to enable it back and this state is not working. Can you please look in to this.

@Banych
Copy link

Banych commented Jul 28, 2020

I have the same problem...

@Tichandr
Copy link
Author

@gitbrent Any update on this?

@zfarhad
Copy link

zfarhad commented Sep 24, 2020

@gitbrent I can fix this issue and make a pull request. If you approve, I will do it.

@mskzo
Copy link

mskzo commented Nov 12, 2020

Same thing for onstyle property. If you change the parameter after the first render it will be ignored.

@DXAizpiri
Copy link

Hey there @gitbrent ! First of all thanks for the library, really appreciated. Any plan on fixing this issue for the "disabled", "onstyle" and "offstyle" properties value updating? I'm experiencing the issue too :S

@bosepher
Copy link

If this can help anyone else. I quickly hacked around this by wrapping the switch in a div, and removing pointer events via a class or style. You can also play with opacity to make it look faded. Note that you can use bootstrap 5 classes 'pe-none' and 'pe-auto' instead of your own.

<div className={`${isDisabledCondition ? 'noPointerEvents', 'inheritPointerEvents'}`}>
<BootstrapSwitchButton />
</div>

<div style={{pointerEvents: `${isDisabledCondition? 'none' : 'inherit'}`}}>
<BootstrapSwitchButton />
</div>

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

6 participants