thelebdev / ng2-currency-mask

A very simple currency mask directive that allows using a number attribute with the ngModel.
MIT License
0 stars 3 forks source link

Selected value is unselected when a cursor fix is triggered #12

Open guillep2k opened 5 years ago

guillep2k commented 5 years ago

Migrated from original project (https://github.com/cesarrew/ng2-currency-mask/issues/114)

Orignal request by @lordazzi

In input.service.ts:

I think you must maintain the cursor end position if it is different of the cursor start position and major the prefix length. In my project, when I select an input the value must be fully select to help the user change it easily, but the library kills the selection when focus comes from keyboard interaction.