Click doesn't toggle switch, only dragging works
See original GitHub issueI’m attaching a gif showing the behavior. When I click on the switch it doesn’t do anything at all. It can only be toggled by dragging it and even then the animation makes a jump. https://gfycat.com/VagueNeglectedBonobo
I’m using React 16.8.1 and react-switch 4.0.1 in a create-react-app project where I manually updated React. Here’s how I’m using the switch:
<Switch
onChange={checked => console.log(checked)}
width={112}
height={45}
onColor={colorPalette.primary}
offColor={colorPalette.gray}
offHandleColor={colorPalette.dark}
handleDiameter={30}
uncheckedIcon={false}
checkedIcon={false}
checked={isRunning}
onColor="#2e91e9"
id="normal-switch"
/>
What could be causing the behavior?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Paper-toggle-button not allowing drag · Issue #125 - GitHub
Click and drag the paper-toggle-button to its opposite state · Release the mouse · Click and drag the paper-toggle-button its opposite state ...
Read more >Android Switch Button Drag off Click/Drag On - Stack Overflow
I extended off of the switch control and created an interface for objects that want to act upon certain drag events. Please see...
Read more >How to Fix Mouse Right-click Button Not Working in Windows ...
How to fix the mouse right- click button not working on Windows 10 PC? Is your mouse right- click button not working ?...
Read more >Turn On/Off Mouse Click Lock in Windows 10/8/7 [Tutorial]
Turn On/Off Mouse Click Lock in Windows 10/8/7 [Tutorial]Clicklock is the feature in Windows that allows you to use single- clicks to act...
Read more >Right Click not holding in games - Steam Community
The answer: Logitech Mice do this as well. There's a trick to try and fix it: The toggle switch that operates the 'button'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@markusenglund got it, solved it. I think we can close the issue.
@superzadeh I have no idea how you could work around this, sorry.
Yeah, I ended up rolling my own component; slightly more limited in functionality but at least it works in the iframe.
A nice update for this project would be to allow passing a custom window/callback to get the window object;