Creating a Selection in JavaScript doesn't Show the Selection UI

Originator:stephanheilner
Number:rdar://18455024 Date Originated:9/25/2014
Status:Open Resolved:
Product:iOS SDK Product Version:All
Classification: Reproducible:Always
 
Summary:
When creating a selection object in JavaScript on iOS, the native selection UI (selection grabbers and blue box) do not appear. We are using UIWebView to render content that the user will annotate. Without the ability to create a selection that triggers the selection UI we are blocked from allowing the user update and adjust their highlights.

Steps to Reproduce:
http://jsfiddle.net/c6jsa/

Create a javascript Range object, add it to a Selection.

Expected Results:
The blue selection UI with grabbers appears. (UIWebView enters selection mode) The pre-defined selection Range defines the start/end of the grabbers.

Actual Results:
Nothing. The only way to enter selection mode is to long press on text.

The blue selection UI never shows.

Version:
All versions of iOS

Notes:
The desired behavior is to programmatically enter selection mode in UIWebView. Right now, the ONLY way to do that is through a long press gesture on text.

Here's a stackoverflow post where others are desiring the same behavior:

http://stackoverflow.com/questions/16972655/how-to-programmatically-enter-selection-mode-in-a-uiwebview

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!