Join GitHub today
Any element attributes that are functions are added as event handlers #2592
I ran into this issue while developing a tag where I wanted to pass in a function in its
The function itself is not an event handler -- it accepts a string -- but is intended to be included in one within the tag.
The issue is that the function seems to be added to the
I'm not sure that this is a bug but should Riot only attach event handlers for valid event attributes, i.e., only for attribute names matching "on*"? If I did this outside of Riot,
I used the "click" event instead of the "search" event in Plunker. You'll need to open the console, and you'll see both the string and the event logged each time the button is clicked.
I observed this in Chromium and Opera on macOS.
I'm using Riot 3.6.3, but the Plunker above is the latest (3.10.0).
@GianlucaGuarini you created a breaking change for all the people that were using that feature. If attributes handled by a function were considered as event handler by your test suite, you are not allowed to change this in a patch or even a minor version.
How can we rely on your library if you create breaking changed outside of major versions? A lot of our projects were based on that feature and we now have to rewrite all of them because we were handling the click event using the