This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Cursor moves to the one before last position after mouse select all and enter new character #243
Open
Description
Bug
Steps to reproduce:
- Go to the official demo page: https://htmlpreview.github.io/?https://github.com/angular-ui/ui-mask/master/demo/index.html
- Select some mask e.g.
(999) 999-9999
- Enter any characters in the "Masked input" field
- Put the mouse cursor at the end
- Select half of characters with the left mouse key not leaving the input
- Continue selection with the left mouse key outside of input
- Enter any characters
Result: cursor is on the one before last position
Expected behaviour: cursor is on the last position
Reason
The selection lenght is recorded on mouseout
event. When mouse leaves the input and selection is not finished yet, the selection is not recorded anymore. The wrong selection length corrupts the cursor position which leads to the error.
Suggested fix
Record the cursor position on keydown
event too.
Metadata
Metadata
Assignees
Labels
No labels