I have a custom Angular pipe that transforms entered text into a series of dots after the user leaves the input
field. When the user re-enters the input
field, the text should transform back into the entered data, with the carat appearing at the end of the field, regardless of user placement.
This works fine in all browsers, except IE11, where the carat momentarily appears at the end of the input
field, and then jumps to the start of the input
field. This behavior can be seen at this Stackblitz sandbox.
How can I transform the data with an Angular pipe while keeping the carat at the end of the input
field across all browsers?
Edit: I've refactored my code and utilized setSelectionRange()
as suggested by Zhi Li's answer.