-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection events for text controls #53
Comments
ping? |
Sorry for the delayed response. That makes sense to me given other events on textarea/input. An alternative is to add a property on selectionchange/selectstart events that specify which input/texarea it originated from. |
I really preferred if we didn't do that, since that would make these events different than the other ones for input/textarea, and the selection APIs for those elements are already different from the global selection API. (BTW I think this is the only spec issue we're waiting on before we can ship this API in Gecko...) |
(#54 too) |
I think we can close this issue by firing |
@choniong @ojanvafai @dtapuska for Blink feedback on this issue. |
@tkent-google @yosinch since this is a form spec issue. I understand what's said, but it's also strange that |
#53 (comment) looks good to me. I also think event.target should be input/textarea in such case. |
Are you intending that selectionchange will bubble when fired at an input element? |
That is already true when call |
Here's a WebKit bug about this for example: https://bugs.webkit.org/show_bug.cgi?id=108043 |
Chrome currently triggers |
Fired the events only on |
I discussed that with @saschanaz and reportedly |
In most cases, it must be correct. However, looks like the patches for Gecko, it's fired on any Anyway, it seems that the events should be fired only when the editable content is focused or should have something new attribute like |
BTW, one suggestion from @smaug---- was to fire on each |
Another alternative is fire it on input & textarea then fire it again on its document. It's funky but maybe that's the most web compatible way to get to the interoperability? I think using |
The current spec doesn't explain what needs to happen for
input
andtextarea
elements when the selection inside them changes. Those selections are not associated with theSelection
object for aDocument
, so we need to handle them somehow.I think a nice way to extend the current spec to cover this case would be to dispatch
selectstart
andselectionchange
to theinput
ortextarea
element itself when the selection inside them changes. The reason why theselectionchange
event needs to be dispatched to the element and not theDocument
is that the web page would otherwise be unable to detect which selection has changed.The text was updated successfully, but these errors were encountered: