Closed titoBouzout closed 5 days ago
Probably oncapture:
can be removed here, but that would be a breaking change https://github.com/search?q=repo%3Aryansolid%2Fdom-expressions%20oncapture&type=code
This is actually an interesting feature to put in.
Yeah I like the implications of this. Not needing oncapture: etc and allowing full config of native events seems a real win. I might be releasing one more minor of Solid 1.x and I'd like to see this get in.
@titoBouzout I hope we don't forget to add this to the docs. :)
@davedbase already on my mind, I will look if typings need updates and how to add tests so gets ready for merging, stay tuned
ok if I am not missing anything I think this is ready for review
CustomEventHandlerUnion
which accepts a regular function or the object formaddEventListener
instead of the browser one, as it has the logic for checking if options
it's an object. This has the nice side effect that output when minified should become smaller as node.addEventListener(...)
will become $addEventListener(node, ...)
CustomCaptureEvents
as deprecatedConsiderations:
addEventListener
function signature types be improved to use the ones defined on client.d.ts
?should close: https://github.com/solidjs/solid/issues/2210 https://github.com/solidjs/solid/issues/1939 https://github.com/solidjs/solid/issues/1786
Thanks!
@ryansolid pinging as it was noted the desired to include it on next release
docs update at https://github.com/solidjs/solid-docs-next/pull/866
This solves in a simple way the common need of wanting to use
passive/once/capture
events.addEventListener
has an "obscure" feature of allowing the listener to be in an object with keyhandleEvent
This PR allows this syntax:
I haven't tested this but it should work https://playground.solidjs.com/anonymous/df01ffcb-e7dc-4a36-b80d-51a398c02689
This is what pota does https://github.com/potahtml/pota/blob/master/src/lib/reactive.js#L1372