Skip to content

Commit 3b3eb32

Browse files
committed
Fix: [ref: JsDaddy#304]
1 parent 3231443 commit 3b3eb32

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/app/app.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ <h1 class="title">
201201
matInput
202202
placeholder="Clear if not match"
203203
[clearIfNotMatch]="true"
204-
mask="000.000 0*.00"
204+
mask="000.000 0"
205+
[showMaskTyped]="true"
205206
[formControl]="clearIfNotMatch"
206207
[(ngModel)]="clearIfNotMatchModel"
207208
/>

src/app/ngx-mask/mask.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export class MaskService extends MaskApplierService {
173173
public clearIfNotMatchFn(): void {
174174
if (
175175
this.clearIfNotMatch &&
176-
this.prefix.length + this.maskExpression.length + this.suffix.length !== this._formElement.value.length
176+
this.prefix.length + this.maskExpression.length + this.suffix.length !==
177+
this._formElement.value.replace(/_/g, '').length
177178
) {
178179
this.formElementProperty = ['value', ''];
179180
this.applyMask(this._formElement.value, this.maskExpression);

0 commit comments

Comments
 (0)