Is there a way to programmatically clear a selection box in Mobile Safari? I tried window.getSelection().removeAllRanges()
as suggested by the answers to another Stack Overflow question, Clear Text Selection with JavaScript, and while the Selection object is reset to no selection (type is "None", isCollapsed is true
, rangeCount is 0, and the anchorNode
/focusNode
/baseNode
/extentNode
are null
), the selection box remains on screen:
I also tried window.getSelection().collapse()
, but that did not work.
I am testing iOS 7.1 Simulator as well as Mobile Safari on an iPad running iOS 7.1.1.