-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Successive clicks on label are throttling OnChange listener #5
Comments
@bluSCALE4 I'm not sure if I get you right. |
@maciejmyslinski if you click on the label for girl or boy in quick succession, you'll see that both isn't updated as expected. But if you click the label for girl boy slowly, it works as expected. |
wow, that's strange @bluSCALE4. I'll try to write a test case for it. |
I took a look at the test on #10, and while I haven't yet figured a way to make it pass, I've been playing with this "both or several" checkboxes pattern. Check out this sandbox. I think that maybe using calculated fields might be a more powerful way to accomplish this sort of logic. Thoughts? |
@erikras my thoughts on this is that's the wrong paradigm to use in the first place. React is all about being declarative and render according to the state. |
What you're doing, though, is not rendering, it's adding some logic to the data flow. The "calculated fields" thing is just listening for changes on a field and updating other fields. Is there another way? |
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
When a user clicks on a checkbox label, the event on the input is throttled causing the listening field stale to become stale.
What is the expected behavior?
It should toggle quickly like clicking on the input directly does.
Sandbox Link
https://codesandbox.io/s/zk2kmrwppm
Check both boys and girls then successively click the boys/girls label.
What's your environment?
OSX, Node v8.11.1, npm 5.6.0
Other information
This example is being used for another issue.
The text was updated successfully, but these errors were encountered: