RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.37k stars 2.17k forks source link

caret position if suffix is defined #2728

Open kiff86 opened 11 months ago

kiff86 commented 11 months ago

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' });

kiff86 commented 11 months ago

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

xvolt commented 4 months ago

Same problem. Looking for a way to keep the caret before the suffix part.