I recently created a custom directive in Angular 9 that allows users to input only digits and one decimal point. While the directive works perfectly on desktop, it seems not to function at all on mobile devices - almost as if it doesn't exist within the input field. I utilized the keydown event as the host for this directive. Is this potentially an issue related to Angular itself? Any tips or references to existing posts that could help me resolve this?
EDIT
@Directive({
selector: 'input[allowCurr]',
host: { '(keydown)': 'allowND($event)' }
})
export class AllowCurrDirective {
@Input() allowCurr: string;
/* More logic implemented here */
}
I included the code snippet above because I had added an alert inside my allowND function, and while it does trigger, the event.key property (used to capture user input) returns undefined.