react-switch icon indicating copy to clipboard operation
react-switch copied to clipboard

Switch should animate even when disabled

Open sbefort opened this issue 4 years ago • 2 comments

If you click on the switch and disable it immediately through a state update, it should still animate to the on/off positions while disabled. Instead, there is a white flash until the phantom animation completes, then it's put in a disabled status and appears again.

sbefort avatar May 14 '21 19:05 sbefort

I achieved a similar effect in a project using the React Transition Group package. http://reactcommunity.org/react-transition-group/css-transition

Hope it helps!

djD-REK avatar May 14 '21 20:05 djD-REK

Sandbox: https://codesandbox.io/s/friendly-goldstine-v5x43?file=/src/index.js For me it works just as expected - when clicked the switch changes position and turns grey, all smoothly animated. Could someone fork the sandbox/describe how to see the issue?

markusenglund avatar Aug 15 '21 15:08 markusenglund