You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, zfarhad, johannesschrimpf, 7ruth, tsuz and 2 more
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
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.
Activity
Banych commentedon Jul 28, 2020
I have the same problem...
Tichandr commentedon Jul 29, 2020
@gitbrent Any update on this?
zfarhad commentedon Sep 24, 2020
@gitbrent I can fix this issue and make a pull request. If you approve, I will do it.
mskzo commentedon Nov 12, 2020
Same thing for onstyle property. If you change the parameter after the first render it will be ignored.
DXAizpiri commentedon Oct 15, 2021
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 commentedon May 26, 2023
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>