markusenglund / react-switch

A draggable toggle-switch component for React. Check out the demo at:
https://react-switch.netlify.com/
MIT License
1.33k stars 101 forks source link

Not a bug as such - In Responsive Design Mode in Firefox clicking causes 2 actions. - seems ok in Chromes reactive mode #45

Closed rluiten closed 5 years ago

rluiten commented 5 years ago

I borrowed this demo from another issue as it shows the behavior I experienced in a local app. https://codesandbox.io/s/vmwpv6x2ql

If I run the demo in Firefox then open the output in a new window, in that new window open developer tools and enable Responsive Design Mode. Then clicking (not dragging) on the react-switch-handle in and off state will fire onChange twice off then on, similarly clicking in an on state will fire onChange twice on then off.

Attached a video capture of it, the drag works fine but single click shows double action.

example-react-switch-double-action

Testing in Chrome and Firefox on Android it doesn't show this behavior, its only the Firefox Responsive design mode so this isn't a bug IMO just thought its worth knowing about and being concious of.

markusenglund commented 5 years ago

Hm ok. The sandbox has a switch that is inside of an iframe which doesn't work with this library as discussed in #35, so I'm not sure if you've discovered anything new or it's that same problem.