igTextEditor selects all the text when the browser window gets focused again
ymita opened this issue · comments
Description
If the first character is contained as selected text on igTextEditor, it selects all the text when the browser window gets focused again. igTextEditor's selectionOnFocus option is set to "browserDefault", and the result between igTextEditor and input(or textarea) is different.
- ignite-ui version: 20.1.8
- browser: n/a
Steps to reproduce
- Run the sample
- Select some characters - make sure the first character is also selected
- Switch to other window
- Switch back to the browser
Result
All the characters are selected.
Expected result
Selected characters remain the same.
Note
On Line 3692, If I change the first if statement as if (startPosition >= 0)
instead of if (startPosition)
, the behavior above is solved.
https://github.com/IgniteUI/ignite-ui/blob/master/src/js/modules/infragistics.ui.editors.js#L3692
Attachments
There is another case that selects all the text upon igTextEditor focus.
Steps
- Set the caret before the first character
- Switch to other window
- Switch back to the browser
Actual result
All the characters on the editor are selected.
Expected result
No character is selected and the caret remains before the first character.