0

I'm trying to detect when a user has finished resizing a text selection on iOS, using Javascript.

While I'm aware of the selectionchange even , if the user uses the native controls I'll get a lot of scroll events, and a few selectionchange.

Now, I have no idea when the user is done, however. If he spends 5 minutes with his finger down, without moving the controls nor changing the selection, I don't get a "mouseup equivalent" event.

EDIT: ...my situation is basically this one: https://developer.apple.com/library/ios/DOCUMENTATION/AppleApplications/Reference/SafariWebContent/Art/events_information_bubble.jpg

Any idea how this could be achieved?

Thanks!

nkkollaw
  • 1,947
  • 1
  • 19
  • 29
  • Why not listen for touchend events? – David Jones Jan 25 '14 at 20:35
  • Doesn't fire one. Looks like if the element receiving the event is a native UI control, touchend is not fired (well, I'm not sure about this, but in my case only scroll gets fired and nothing after that). – nkkollaw Jan 25 '14 at 21:02

1 Answers1

1

I've found that selectionchange event fires multiple times even on a single word selection (with a tap or a long press), and of course it fires when you drag the selection handles ...

Here is a workaround i have created (not a perfect one) to get only the text selection end event.

you can see it here: End of text selection event?

or in a small post on my blog: http://www.dimshik.com/end-of-text-selection-event-on-ios-workaround/

Community
  • 1
  • 1
dimshik
  • 1,251
  • 15
  • 17
  • Yep. That's what I'm doing, too. I guess there is no solution but that. Can you confirm that touchend events are not fired (perhaps because the handles are not part of the webpage, but the OS)..? – nkkollaw Apr 02 '14 at 21:07