Would it be possible to add an input event to the InputMask? Currently it's not possible to easily capture user inputs.
Using the InputMask as Directive (#3782) would be a better approach to avoid unnecessary event delegation...
All inputs should be rewritten as a directive imo... that way one could combine inputMask with other directives.
This still doesn't seem to be working, onInput never seems to fire.
See: https://stackblitz.com/edit/angular-b3egqh -> onInput never logs to the console. onFocus and onComplete work fine though.
I have encountered this exact issue as well, has there been any progress towards resolution? onBlur, onFocus, onComplete all emit. Also, if you paste text into the input mask it does emit the method that is hooked up to (paste) inside of the InputMask component, however if you type in the text character by character, it doesn't. So my assumption is that there is some issue in (input)="onInputChange($event)" as the one attached to paste works fine: (paste)="handleInputChange($event)".
still an issue in v8.1.1
I found I can use registerOnChange(fn) to register an input event by myself. I thought it might resolve the onInput event not emit problem.
First, I bind an id on html element like this:
<p-inputMask #receiptDateInput></p-inputMask>
And then, I write the registerOnChange(fn) logic in ngOnInit like this:
@ViewChild('receiptDateInput') receiptDateInput: InputMask;
ngOnInit() {
this.receiptDateInput.registerOnChange(this.onReceiptDateInput);
}
onReceiptDateInput(event: any): void {
console.log(event);
}
Most helpful comment
I have encountered this exact issue as well, has there been any progress towards resolution? onBlur, onFocus, onComplete all emit. Also, if you paste text into the input mask it does emit the method that is hooked up to (paste) inside of the InputMask component, however if you type in the text character by character, it doesn't. So my assumption is that there is some issue in (input)="onInputChange($event)" as the one attached to paste works fine: (paste)="handleInputChange($event)".