Skip to content

Commit

Permalink
Fixed #9888 - p-inputnumber infinite loop when using buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Feb 15, 2021
1 parent bdfab37 commit 9ef5da3
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/app/components/inputnumber/inputnumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export class InputNumber implements OnInit,ControlValueAccessor {

@Input() buttonLayout: string = "stacked";

@Input() disabled: boolean;

@Input() inputId: string;

@Input() styleClass: string;
Expand Down Expand Up @@ -166,6 +164,8 @@ export class InputNumber implements OnInit,ControlValueAccessor {

_suffixOption: string;

_disabled: boolean;

@Input() get locale(): string {
return this._localeOption;
}
Expand Down Expand Up @@ -256,6 +256,21 @@ export class InputNumber implements OnInit,ControlValueAccessor {
this.updateConstructParser();
}


@Input() get disabled(): boolean {
return this._disabled;
}

set disabled(disabled: boolean) {
if (disabled)
this.focused = false;

this._disabled = disabled;

if (this.timer)
this.clearTimer();
}

constructor(public el: ElementRef, private cd: ChangeDetectorRef) { }

ngOnInit() {
Expand Down

0 comments on commit 9ef5da3

Please sign in to comment.