Skip to content

Update Switch.js #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update Switch.js #80

wants to merge 1 commit into from

Conversation

gravitymedianet
Copy link

Doesn't allow for custom onChange or checked prop & to override "switchability" such as to preventDefault() -- this does.

Doesn't allow for custom onChange or checked prop & to override "switchability" such as to preventDefault() -- this does.
@jinixx
Copy link

jinixx commented Jul 25, 2019

hi @xidedix can this be merged please?

Just ran into this, when a toggle action is rejected, toggle state remains toggled even though checked remains unchanged.

Thanks!

@xidedix
Copy link
Member

xidedix commented Jul 25, 2019

@gravitymedianet @jinixx
it looks like a breaking change

@gravitymedianet
Copy link
Author

@xidedix can you elaborate how this breaks it, or give an example?

If it is a breaking change, what would be the correct way to supply a custom function?

@xidedix
Copy link
Member

xidedix commented Jul 25, 2019

@jinixx in your case props.checked and state.checked went out of sync
we are working on the solution
@gravitymedianet thanks for the fix, we're trying to find the way without introducing breaking changes

@jinixx
Copy link

jinixx commented Jul 26, 2019

@xidedix thanks. A work around I'm using now is, allowing the props 'checked' to toggle first onchange, and toggle 'checked' again when (if) toggle action is rejected.

@xidedix xidedix closed this May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants