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 need this component to be controlled so I can set its state as a part of making an API call. Here is my flow:
Toggle switch on.
Make API call.
Disable switch while call is in progress.
Enable switch when call finishes.
Toggle switch on/off depending on API result.
With the current component I can't do step 5 as the component will always change the switch's states. I could do something kind of funny like throw an exception in my change handler but I that's probably not advised.
I will try and open a corresponding PR to fix this change.
The text was updated successfully, but these errors were encountered:
The
EbaySwitch
component allows achecked
prop to control its value, but on change this prop does not get enforced properly. Other controlled components likeEbayCheckbox
don't have this issue. I have a small sandbox and demo video to demonstrate issue: https://codesandbox.io/p/sandbox/dreamy-wozniak-xqlpqc?file=%2Fsrc%2FApp.tsx%3A10%2C32Screen.Recording.2023-12-05.at.3.09.14.PM.mov
I need this component to be controlled so I can set its state as a part of making an API call. Here is my flow:
With the current component I can't do step 5 as the component will always change the switch's states. I could do something kind of funny like throw an exception in my change handler but I that's probably not advised.
I will try and open a corresponding PR to fix this change.
The text was updated successfully, but these errors were encountered: