JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.16k stars 300 forks source link

showMaskTyped change causes caret to jump to end of field #1246

Closed dfrye7 closed 1 year ago

dfrye7 commented 1 year ago

🐞 bug report

Is this a regression?

No, present in previous versions.

Description

When the user enters some data into the masked field, and then something external to the user's input (an observable, timeout, etc.) changes showMaskTyped from "false" to "true", the caret jumps to the end of the field rather than maintaining it's position where the user is typing.

🔬 Minimal Reproduction

StackBlitz demonstration: https://stackblitz.com/edit/angular-pkhtfx?file=src%2Fmain.ts

🔥 Exception or Error

Caret jumps to end of the field

🌍 Your Environment

Angular Version:


16.2.2
andriikamaldinov1 commented 1 year ago

@dfrye7 Thanks for using Ngx-mask. Please update to latest version. All work as expected - https://stackblitz.com/edit/angular-krqaud?file=src%2Fmain.ts