-
-
Notifications
You must be signed in to change notification settings - Fork 148
v3.10.0 broke the onChange for the input radio #288
Comments
Awesome and thanks a bunch for the quick PR! |
This breaks when I stopped deletion of the onChange prop with Firefox triggers the onChange callback twice. (Chrome and Safari work as expected, haven't tried IE/Edge). |
I think @cedmax's fix would fix that case too. |
Agree with @mjsisley, the event onChange (and onInput) for
(That works correctly when using preact only.) |
Here's a thought: what if we changed this line from its current implementation: let attr = nodeName==='input' && /^che|rad/i.test(attributes.type) ? 'onclick' : 'oninput', ...to: let attr = nodeName==='input' && /^fil|che|rad/i.test(attributes.type) ? 'onchange' : 'oninput', ... think that'd work? IIRC |
Awesome @developit, this fix seems to do the job, Thanks 👍 . Looking forward to get this fix release 🎉 |
Fixed on master! Waiting for a resolution to #292 before we release. |
The changes to fix the onChange being executed twice for the checkboxes (issue: preactjs/preact#358, pr: #247) introduced a problem with the input[type="radio"]: looking at the code it seems like you are deleting the onChange for any input type not checkbox, in favour of an onInput, but the radio wouldn't work with it.
I created a pull request for it too
#287
The text was updated successfully, but these errors were encountered: