ngx-mask
ngx-mask copied to clipboard
Backspace and Delete not working as expected on masked inputs (Reactive Forms + Material)
When input is masked, and showMaskTyped is set to true, Backspace and Delete do not work as expected. It is not possible to delete a character, at least it is displayed like it was not deleted. Attached a screencast that demonstrates it.
Setup:
- Angular 9, Angular Material 9, Reactive Forms
- ngx-mask v9.1.2
backspace-and-delete-not working-on-masked-inputs-screencast.zip
Backspace isn't working with showMaskTyped=true for me neither, but the problem is different: you can remove the number, but the selection doesn't move. so the selection is after a placeholder character '_' and if you then try another backspace it just doesnt do anything. Also, with mask="Hh:m0" (and showMaskTyped="true"), once the selection position is after the ':' character, triggering backspace doesn't do anything.
Note: core-js is in the polyfills.
Angular 11 mask="0*" Backspace does not remove values. Only delete works.
use input type="text"
use input type="text"
This worked for me! Number inputs ignore quite a bit of keyboard input.
@rfprod @KrakenZ Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-ymwtn4?file=src%2Fmain.ts