Behaviour of onselectionchange
attribute on an element
#1809
Labels
A-yew
Area: The main yew crate
bug
S-waiting-on-author
Status: awaiting action from the author of the issue/PR
Problem
I mean to do something when text is selected. I built an example app for this issue, where when text is selected, the selection is displayed under the text.
Steps To Reproduce
I first attempted to use a callback on
onselectionchange
to trigger a new render, see example. This does not work. Note that using aonmousemove
attribute, I get the expected high level behaviour when selecting with the mouse, see example.Registering an event listener on the document works, see example.
Expected behavior
onselectionchange
attribute to be enough to register a callback on the selectionchange event.I note that
selectionchange
is a document event (mdn) while for examplemousemove
is an element event (mdn). Ifonselectionchange
is not meant to be put on adiv
I would maybe expect that compilation fails?Environment:
The text was updated successfully, but these errors were encountered: