IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics

Home Page:https://bit.ly/2kuu1fT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Run the sample
  2. Select some characters - make sure the first character is also selected
  3. Switch to other window
  4. 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

igTextEditor selection behavior.zip

editor-selection

There is another case that selects all the text upon igTextEditor focus.

Steps

  1. Set the caret before the first character
  2. Switch to other window
  3. 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.