(keydown) event is not working in device


#1

<ion-input type=“text” [(ngModel)]=“ulblevel.society"name=“society” placeholder=“Society Name*” (keydown.space)=”$event.preventDefault()" (keydown)=“keyPressed($event)”>

keyPressed($event)
 {
   console.log($event);
   if($event.key!=" ")
   {
     if($event.key=="Backspace")
     {
        this.sname = this.sname.slice(0,-1);
     }
     else
     this.sname += $event.key;
   }
 }

The above code is working fine in browser but not in device