ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Backspace and Delete not working as expected on masked inputs (Reactive Forms + Material)

Open rfprod opened this issue 5 years ago • 4 comments

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

rfprod avatar Jul 03 '20 08:07 rfprod

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.

azephiris avatar Jul 24 '20 10:07 azephiris

Angular 11 mask="0*" Backspace does not remove values. Only delete works.

dobromyslov avatar Feb 03 '21 08:02 dobromyslov

use input type="text"

BibinBaby03 avatar Feb 05 '21 07:02 BibinBaby03

use input type="text"

This worked for me! Number inputs ignore quite a bit of keyboard input.

peteorpeter avatar Sep 14 '21 12:09 peteorpeter

@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

andriikamaldinov1 avatar Jun 19 '23 09:06 andriikamaldinov1