dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Support event handlers in element extensions

Open fabxc opened this issue 1 year ago • 0 comments

Feature Request

The #[props(extends = ... feature is based on a generated list of available attributes today which does not seem to include event handlers (onclick, onpointerleave, ...). This should be supported as otherwise these attributes still need to be prop-drilled all the way. To really make this smooth it would probably need passing EventHandler<_> to primitive HTML elements to work, i.e. not requiring onclick=move |e| handler.call(e).

Maybe it's even fine to allow propagating truly arbitrary attributes? That gives up type safety but is in line with HTML also allowing arbitrary attributes, e.g. for interpretation by other libraries.

fabxc avatar May 23 '24 04:05 fabxc