-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Minified Preact code causing Error by storing event handlers in l
property on elements causing a name conflict
#4461
Comments
l
propertyl
property on elements causing a name conflict
While I'm not immediately aware of any usages, our Changing it might be breaking.
Preact X supports IE 11 yet, |
Hi, thank you so much for clarifying. While a |
And we will, but for the meantime, you will probably need to alter your usage is all.
As mentioned...
|
Just out of curiosity, how do you end up with |
Describe the bug
Preact stores references to an element's event handlers inside a
_listeners
property on the element itself — this gets compiled to justl
causing a conflict in case a form element with the same name exists inside a form — leading to this error:To Reproduce
HTMLFormElement
containing one or severalHTMLInputElement
submit
handler to the form (the event handler can contain a simpleconsole.log
)l
e.g.<input name="l">
Here's a StackBlitz link where you can test it out.
Expected behavior
When submitting the form, the event handler should be invoked resulting in a log statement in the browser dev tools.
Actual behavior
An error is thrown.
Possible Solution
Consider using a
Symbol
for the property key storing event handlers on elements.The text was updated successfully, but these errors were encountered: