I have developed a custom directive in angular 9 to enter only digits and 1 decimal. The directive works flawlessly in desktop but not in mobiles (as if the directive is not even present in the input field). I used keydown event as the host. Is this an issue in Angular side? Any suggestions or existing posts that I need to refer.
EDIT
@Directive({
selector: 'input[allowCurr]',
host: { '(keydown)': 'allowND($event)' }
})
export class AllowCurrDirective {
@Input() allowCurr: string;
/* Rest of my Logic here */
}
I added this much because I had put alert inside my allowND function, it is going inside it but event.key, that I had used to capture user key input, is coming undefined.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…