Skip to content

Commit d648b87

Browse files
fix(ref:1560): fix issue
fix(ref:1560): fix issue
2 parents 683006a + 1fc15d7 commit d648b87

14 files changed

+1882
-1140
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 21.0.1(2026-01-29)
2+
3+
### fix
4+
5+
- Fix ([#1585](https://github.com/JsDaddy/ngx-mask/issues/1585))
6+
- Fix ([#1560](https://github.com/JsDaddy/ngx-mask/issues/1560))
7+
18
# 21.0.0(2026-01-28)
29

310
### fix

bun.lock

Lines changed: 94 additions & 1074 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-mask",
3-
"version": "21.0.0",
3+
"version": "21.0.1",
44
"description": "Awesome ngx mask",
55
"license": "MIT",
66
"engines": {
@@ -60,25 +60,15 @@
6060
"url": "https://github.com/JsDaddy/ngx-mask.git"
6161
},
6262
"dependencies": {
63-
"@angular/animations": "21.1.1",
64-
"@angular/common": "21.1.1",
65-
"@angular/compiler": "21.1.1",
66-
"@angular/core": "21.1.1",
67-
"@angular/forms": "21.1.1",
68-
"@angular/platform-browser": "21.1.1",
69-
"@angular/platform-browser-dynamic": "21.1.1",
70-
"@angular/router": "21.1.1",
71-
"@types/jest": "30.0.0",
72-
"@types/mocha": "10.0.10",
73-
"cypress": "15.9.0",
63+
"@angular/animations": "21.1.2",
64+
"@angular/common": "21.1.2",
65+
"@angular/compiler": "21.1.2",
66+
"@angular/core": "21.1.2",
67+
"@angular/forms": "21.1.2",
68+
"@angular/platform-browser": "21.1.2",
69+
"@angular/router": "21.1.2",
7470
"highlight.js": "11.11.1",
75-
"ngx-highlightjs": "14.0.1",
76-
"ngxtension": "7.0.2",
77-
"rxjs": "7.8.2",
78-
"semantic-release": "25.0.2",
79-
"semantic-release-export-data": "1.2.0",
80-
"snyk": "1.1302.1",
81-
"@tailwindcss/postcss": "4.1.18"
71+
"ngx-highlightjs": "14.0.1"
8272
},
8373
"devDependencies": {
8474
"@angular-devkit/build-angular": "21.1.2",
@@ -88,33 +78,38 @@
8878
"@angular-eslint/schematics": "21.1.0",
8979
"@angular-eslint/template-parser": "21.1.0",
9080
"@angular/cli": "21.1.2",
91-
"@angular/compiler-cli": "21.1.1",
92-
"@angular/language-service": "21.1.1",
81+
"@angular/compiler-cli": "21.1.2",
82+
"@angular/language-service": "21.1.2",
83+
"@angular/platform-browser-dynamic": "21.1.2",
9384
"@commitlint/cli": "20.3.1",
9485
"@commitlint/config-conventional": "20.3.1",
95-
"@jscutlery/cypress-angular": "0.9.22",
86+
"@tailwindcss/postcss": "4.1.18",
9687
"@types/highlight.js": "10.1.0",
97-
"@types/node": "25.0.10",
88+
"@types/jest": "30.0.0",
89+
"@types/node": "25.1.0",
9890
"@typescript-eslint/eslint-plugin": "8.54.0",
9991
"@typescript-eslint/parser": "8.54.0",
100-
"@vitest/browser-playwright": "^4.0.18",
92+
"@vitest/browser-playwright": "4.0.18",
10193
"@web/test-runner": "0.20.2",
10294
"angular-cli-ghpages": "3.0.2",
10395
"angular-eslint": "21.1.0",
10496
"angular-http-server": "1.12.0",
10597
"bun-types": "1.3.7",
98+
"cypress": "15.9.0",
10699
"eslint": "9.39.2",
107100
"eslint-config-prettier": "10.1.8",
108101
"eslint-plugin-json": "4.0.1",
109102
"eslint-plugin-prettier": "5.5.5",
110-
"jsdom": "^27.4.0",
103+
"jsdom": "27.4.0",
111104
"lint-staged": "16.2.7",
112105
"markdownlint-cli": "0.47.0",
113106
"ng-packagr": "21.1.0",
114107
"npm-check-updates": "19.3.2",
115108
"postcss": "8.5.6",
116109
"prettier": "3.8.1",
117-
"puppeteer": "24.36.1",
110+
"semantic-release": "25.0.2",
111+
"semantic-release-export-data": "1.2.0",
112+
"snyk": "1.1302.1",
118113
"stylelint": "17.0.0",
119114
"stylelint-config-prettier": "9.0.5",
120115
"stylelint-config-recommended-scss": "17.0.0",
@@ -123,7 +118,7 @@
123118
"type-coverage": "2.29.7",
124119
"typescript": "5.9.3",
125120
"typescript-eslint": "8.54.0",
126-
"vitest": "^4.0.18"
121+
"vitest": "4.0.18"
127122
},
128123
"typeCoverage": {
129124
"atLeast": 91,

projects/ngx-mask-lib/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-mask",
3-
"version": "21.0.0",
3+
"version": "21.0.1",
44
"description": "awesome ngx mask",
55
"keywords": [
66
"ng2-mask",
@@ -28,9 +28,9 @@
2828
"url": "https://github.com/JsDaddy/ngx-mask/issues"
2929
},
3030
"peerDependencies": {
31-
"@angular/common": ">=14.0.0",
32-
"@angular/core": ">=14.0.0",
33-
"@angular/forms": ">=14.0.0"
31+
"@angular/common": "^21.0.0",
32+
"@angular/core": "^21.0.0",
33+
"@angular/forms": "^21.0.0"
3434
},
3535
"dependencies": {}
3636
}

projects/ngx-mask-lib/src/lib/ngx-mask-applier.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ export class NgxMaskApplierService {
702702
this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING] &&
703703
this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]?.optional
704704
) {
705+
// If the input symbol is whitespace or doesn't match the pattern,
706+
// skip it without consuming the mask position
707+
if (inputSymbol.trim() === MaskExpression.EMPTY_STRING) {
708+
// Skip whitespace input, don't advance mask cursor
709+
continue;
710+
}
705711
if (
706712
!!inputArray[cursor] &&
707713
maskExpression !== '099.099.099.099' &&

projects/ngx-mask-lib/src/lib/ngx-mask.directive.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,11 +1046,20 @@ export class NgxMaskDirective
10461046
.replace(MaskExpression.DOT, MaskExpression.COMMA);
10471047
}
10481048
if (this.mask()?.startsWith(MaskExpression.SEPARATOR) && this.leadZero()) {
1049+
const isFirstWrite = !this._maskService.isInitialized;
10491050
requestAnimationFrame(() => {
1051+
// On initial load, temporarily set isInitialized to false
1052+
// so formControlResult returns early and doesn't mark form as dirty
1053+
if (isFirstWrite) {
1054+
this._maskService.isInitialized = false;
1055+
}
10501056
this._maskService.applyMask(
10511057
inputValue?.toString() ?? '',
10521058
this._maskService.maskExpression
10531059
);
1060+
if (isFirstWrite) {
1061+
this._maskService.isInitialized = true;
1062+
}
10541063
});
10551064
}
10561065
this._maskService.isNumberValue = true;

0 commit comments

Comments
 (0)