Skip to content

Commit

Permalink
fix(#984): cursor jumps at beginning if input '0' or '-'
Browse files Browse the repository at this point in the history
  • Loading branch information
GlebChiz committed May 2, 2022
1 parent 70a02d5 commit 327d09f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<a name="13.1.13"></a>

# 13.1.13(2022-05-02)

### Fix

- Fix ([#984](https://github.com/JsDaddy/ngx-mask/issues/984))

<a name="13.1.12"></a>

# 13.1.112(2022-04-27)
# 13.1.12(2022-04-27)

### Fix

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mask",
"version": "13.1.12",
"version": "13.1.13",
"description": "awesome ngx mask",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-mask-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mask",
"version": "13.1.12",
"version": "13.1.13",
"description": "awesome ngx mask",
"keywords": [
"ng2-mask",
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-mask-lib/src/lib/mask.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class MaskDirective implements ControlValueAccessor, OnChanges, Validator
@HostListener('ngModelChange', ['$event'])
public onModelChange(value: any): void {
// on form reset we need to update the actualValue
if (!value && this._maskService.actualValue) {
if ((value === '' || value === null || value === undefined) && this._maskService.actualValue) {
this._maskService.actualValue = this._maskService.getActualValue('');
}
}
Expand Down

0 comments on commit 327d09f

Please sign in to comment.