You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add support for custom non-standard DOM events, ideally through a public API but if that's a "no go" at least some way that would not require forking the code base.
I recommend taking inspiration from the battle-tested special event API of jQuery. It has allowed devs to both normalize events across browsers (wheel events for example), and support new kind of events such as triple click (not saying this one's a good idea).
This has been asked for many times before. See discussion in #4751.
It might make sense to allow any function to pass through and become a "simple event plugin" by default. That way there is no whitelist necessarily. This would make it a breaking change if we ever added custom logic to that particular event. Which we likely will. However, that's the stance we've already taking with other attributes in general.
It might make sense to allow any function to pass through and become a "simple event plugin" by default. That way there is no whitelist necessarily. This would make it a breaking change if we ever added custom logic to that particular event. Which we likely will. However, that's the stance we've already taking with other attributes in general.
You could require a specific "simple event plugin" to avoid breaking changes, which could be as simple as:
@sebmarkbage Sort of spurred by #7901, but I've been wanting custom events for a while and had some prior work stripping out the attribute whitelist to support custom attributes (#7311).
I've PR'ed this to myself (against #7311). I'm hesitant to submit a PR against another PR, but I think I'm happy with it. There was a lot of event name munging already happening, I was able to lower that, move most of it to a central location, and lean on the existing SimpleEventPlugin as you'd suggested.
Activity
daukantas commentedon Aug 17, 2015
I hereby add my support to custom non-standard DOM events.
louisremi commentedon Sep 4, 2015
I recommend taking inspiration from the battle-tested special event API of jQuery. It has allowed devs to both normalize events across browsers (wheel events for example), and support new kind of events such as triple click (not saying this one's a good idea).
Gozala commentedon Sep 11, 2015
Is there any chance to get any kind of feedback on this ?
rpominov commentedon Sep 11, 2015
This may be related #4751
sebmarkbage commentedon Sep 14, 2015
This has been asked for many times before. See discussion in #4751.
It might make sense to allow any function to pass through and become a "simple event plugin" by default. That way there is no whitelist necessarily. This would make it a breaking change if we ever added custom logic to that particular event. Which we likely will. However, that's the stance we've already taking with other attributes in general.
Gozala commentedon Sep 14, 2015
You could require a specific "simple event plugin" to avoid breaking changes, which could be as simple as:
Or more complex but robust as:
nhunzaker commentedon Oct 23, 2016
@sebmarkbage Sort of spurred by #7901, but I've been wanting custom events for a while and had some prior work stripping out the attribute whitelist to support custom attributes (#7311).
So I took a stab:
nhunzaker#2
I've PR'ed this to myself (against #7311). I'm hesitant to submit a PR against another PR, but I think I'm happy with it. There was a lot of event name munging already happening, I was able to lower that, move most of it to a central location, and lean on the existing
SimpleEventPluginas you'd suggested.Does this feel like the right track?
nhunzaker commentedon Jul 11, 2017
We have a few duplicates of this issue, so I'm closing it out. This should land with #7311