Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
Apache Flex 4.12.0
-
None
-
None
-
Seen on Mac OS X 10.9; other platforms are probably also affected
Description
Calling setFocus() on an unfocused TextInput, followed immediately by selectRange(desiredInsertionPointIndex, desiredInsertionPointIndex) will select the entire text in the RichEditableText.focusInHandler() instead of selecting nothing and moving the insertion point to the desired index.
This is due to the fact that RichEditableText.selectRange() sets the internal hasProgrammaticSelectionRange flag to true iff the anchor and active positions of the selection are different. I wonder why we cannot simply set hasProgrammaticSelectionRange to true even if the two positions are equal.
Workaround: setting multiline=true forces the focusInHandler to take a different route and avoid the selectAll() call inside the focusInHandler that alters the selection.