Skip to content

Commit

Permalink
Refactor #9718
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Feb 17, 2021
1 parent da9a9f1 commit b84441c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app/components/inputmask/inputmask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const INPUTMASK_VALUE_ACCESSOR: any = {
selector: 'p-inputMask',
template: `<input #input pInputText class="p-inputmask" [attr.id]="inputId" [attr.type]="type" [attr.name]="name" [ngStyle]="style" [ngClass]="styleClass" [attr.placeholder]="placeholder" [attr.title]="title"
[attr.size]="size" [attr.autocomplete]="autocomplete" [attr.maxlength]="maxlength" [attr.tabindex]="tabindex" [attr.aria-label]="ariaLabel" [attr.aria-required]="ariaRequired" [disabled]="disabled" [readonly]="readonly" [attr.required]="required"
(focus)="onInputFocus($event)" (blur)="onInputBlur($event)" (keydown)="onKeyDown($event)" (keypress)="onKeyPress($event)" [attr.autofocus]="autoFocus"
(focus)="onInputFocus($event)" (blur)="onInputBlur($event)" (keydown)="onInputKeydown($event)" (keypress)="onKeyPress($event)" [attr.autofocus]="autoFocus"
(input)="onInputChange($event)" (paste)="handleInputChange($event)">`,
host: {
'[class.p-inputwrapper-filled]': 'filled',
Expand Down Expand Up @@ -105,7 +105,7 @@ export class InputMask implements OnInit,OnDestroy,ControlValueAccessor {

@Output() onInput: EventEmitter<any> = new EventEmitter();

@Output() onKeyDown: EventEmitter<any> = new EventEmitter();
@Output() onKeydown: EventEmitter<any> = new EventEmitter();

value: any;

Expand Down Expand Up @@ -395,7 +395,7 @@ export class InputMask implements OnInit,OnDestroy,ControlValueAccessor {
}
}

onKeyDown(e) {
onInputKeydown(e) {
if (this.readonly) {
return;
}
Expand All @@ -407,7 +407,7 @@ export class InputMask implements OnInit,OnDestroy,ControlValueAccessor {
let iPhone = /iphone/i.test(DomHandler.getUserAgent());
this.oldVal = this.inputViewChild.nativeElement.value;

this.onKeyDown.emit(e);
this.onKeydown.emit(e);

//backspace, delete, and escape get special treatment
if (k === 8 || k === 46 || (iPhone && k === 127)) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/components/inputmask/inputmaskdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ <h5>Events</h5>
<td>Callback to invoke on when the input field value is altered.</td>
</tr>
<tr>
<td>onKeyDown</td>
<td>onKeydown</td>
<td>event: KeyboardEvent</td>
<td>Callback to invoke on when the input receives a keydown event.</td>
</tr>
Expand Down

0 comments on commit b84441c

Please sign in to comment.