-
Notifications
You must be signed in to change notification settings - Fork 657
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
events on input like onChange
, onBlur
get called twice
#57
Comments
Thanks! This probably also affects Textarea, Checkbox, and Radio. I tend to think certain props should just be explicitly passed to the form control, but let me think about possible solutions for this. If you want to take a stab at a PR (maybe just start with one component), I'd be happy to take a look at what you're suggesting. |
Just chiming in that this does occur when binding an onClick function to Checkbox |
I can confirm that this also happens for events like |
Im willing to take a stab at this, what do you think would be the best way to go with it, desugar all the event names, or do something like @queckezz described? |
I think I'd prefer desugaring. I also would like tests for events – something I started but didn't have time to wrap up. |
Currently experiencing this issue with |
This probably affect most rebass elements with DOM events since most inherit from Base. |
Hey @jxnblk, awesome library!
When using the
<Input />
component, event handlers always get called twice. This is because you capture all events intorootProps
and after that you apply them to two<Base />
componentsMy best advice is to switch to something like a
rootProps
prop onInput
and then delegate the rest of the props to theInput
component. I can create a pull request if you agree with that.Another option would be to filter out all events and delegate them to the second
<Base />
. This would require a list of events though.EDIT: Same problem exists for
<Select />
The text was updated successfully, but these errors were encountered: