RobinHerbots / Inputmask

Input Mask plugin

Home Page:https://robinherbots.github.io/Inputmask/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

caret position if suffix is defined

kiff86 opened this issue · comments

commented

Hi,
try to mask currency with suffix, but then focus on input, caret position can be set after suffix.
Is it possible that it is not possible to set the cursor to the suffix?

Here the code:
$(this).inputmask('decimal',{ "autoUnmask": true, 'groupSeparator': ' ', 'digits': 2, 'radixPoint': ".", 'allowMinus': false, 'placeholder': '0E', 'rightAlign': true, 'suffix': ' E', onUnMask: function(maskedValue, unmaskedValue) { return unmaskedValue * 100; }, 'positionCaretOnClick': 'radixFocus' });

commented

Generally, it would be great to set the cursor to the leftmost position when focusing on the input