I have an input element which it's value is 'abcdefghijklmnopqrstuvwxyz'
I used ref to highlight the content of 'n' to 'z'
inputRef.current.setSelectionRange(18, 26);
which result into this:
How can I programmatically set the input to this instead?
Additional insight:
If I switch to another tab on the browser and go back to the tab containing this input, it will result in what I want, but I do not know how to make it work with code.

