Closed lucasousi closed 1 month ago
Able to reproduce in 16.4.0 and 17.1.8
16.4.0
17.1.8
When typing a formatted number with a decimalMarker, the cursor unexpectedly jumps to the wrong position after deleting characters.
decimalMarker
Steps to Reproduce:
<input name="with-bug" mask="separator.2" decimalMarker="," thousandSeparator="." />
Expected Result: The cursor should remain to the left of the comma.
Actual Result: The cursor jumps to the right of the comma.
Additional Information:
12.345,00
12.345.600
pt-br
<input name="without-bug" mask="separator.2" thousandSeparator="." />
Impact: This bug affects the user experience by causing confusion and errors in number input fields.
https://stackblitz.com/edit/ngx-mask-cursor-jumping
Angular Version: 18.0.0
Angular CLI: 18.1.1 Node: 18.20.3 Package Manager: npm 10.2.3 OS: linux x64 Angular: 18.1.1 ... animations, cli, common, compiler, compiler-cli, core, forms ... platform-browser, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1801.1 @angular-devkit/build-angular 18.1.1 @angular-devkit/core 18.1.1 @angular-devkit/schematics 18.1.1 @schematics/angular 18.1.1 rxjs 7.8.1 typescript 5.4.5 zone.js 0.14.8
Anything else relevant?
@lucasousi Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-ywyjwa?file=src%2Fboot.module.ts,src%2Fboot.component.ts
π bug report
Is this a regression?
Able to reproduce in
16.4.0
and17.1.8
Description
When typing a formatted number with a
decimalMarker
, the cursor unexpectedly jumps to the wrong position after deleting characters.Steps to Reproduce:
Expected Result: The cursor should remain to the left of the comma.
Actual Result: The cursor jumps to the right of the comma.
Additional Information:
12.345,00
instead of12.345.600
.decimalMarker
is not set (comma by default in my culturept-br
).Impact: This bug affects the user experience by causing confusion and errors in number input fields.
π¬ Minimal Reproduction
https://stackblitz.com/edit/ngx-mask-cursor-jumping
π Your Environment
Angular Version: 18.0.0
Anything else relevant?