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

Separator.0 Does not allow for 0 to be inputted first. #1272

Closed jabennett1515 closed 11 months ago

jabennett1515 commented 1 year ago

🐞 bug report

In the sandbox: https://jsdaddy.github.io/ngx-mask/#1 if you type in 0 first, and then try to type in a number next, it won't let you. In previous versions of this package, it would remove the 0, and then continue on the last number you typed in.

Yes, it used to work in 11.1.4

<input [mask]="'separator.0'" thousandSeparator="," matInput />
  @Component({
    selector: 'app-root',
    standalone: true,
    imports: [CommonModule, RouterOutlet, NgxMaskDirective, NgxMaskPipe,  MatInputModule],
    providers: [provideNgxMask()],
    templateUrl: './app.component.html',
    styleUrl: './app.component.scss'
  })

🌍 Your Environment

Angular Version: 16 Using standalone components and importing the directive for NgxMaskDirective

Armughan3 commented 11 months ago

Same issue is appearing in Angular 14 and Ngx-mask v14.3.2, Please have a look into it.

andriikamaldinov1 commented 11 months ago

@jabennett1515 Thanks for using Ngx-mask. We have added this behaviuor. Please update to 16.4.2 03 => 3 It example - https://stackblitz.com/edit/angular-y5llve?file=src%2Fmain.ts

@Armughan3 Thanks for using Ngx-mask. Please update to 14.3.3