When manually setting selectedRange after inserting new text the visual position of the caret is wrong. Once I start typing, the text goes to the position specified by selectedRange and the caret updates. It seems like there may be caret position updating logic in the replace() function that is conflicting with the selectedRange setter.
What happened?
When manually setting
selectedRange
after inserting new text the visual position of the caret is wrong. Once I start typing, the text goes to the position specified byselectedRange
and the caret updates. It seems like there may be caret position updating logic in thereplace()
function that is conflicting with theselectedRange
setter.What are the steps to reproduce?
What is the expected behavior?
Caret position is display based on the
selectedRange
property.