Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keypress event is not working in Android 4.4.2 device for Ionic 2 App #1836

Closed
bazigatabassum opened this issue Jan 6, 2017 · 3 comments
Closed

Comments

@bazigatabassum
Copy link

I am using keypress event to restrict the special chars in my input. It is going fine with the version lollipop and above, but its not working in Android 4.4.2.
Kindly suggest for this.
Thank You.

@haxwell
Copy link

haxwell commented Oct 14, 2017

I too am having a problem in Ionic regarding the keypress (and key) event.

Ionic v 3.12

<!-- Works in the desktop browser, but onPhoneChange() is never called on the Android device. -->
<ion-input type="text" (keypress)="onPhoneChange($event)" required></ion-input>

@gopi2mohan
Copy link

Any update on this

@imhoffd
Copy link
Contributor

imhoffd commented Feb 21, 2018

keypress is deprecated: https://www.w3.org/TR/DOM-Level-3-Events/#event-type-keypress

Please consider using Angular Form Validation: https://angular.io/guide/form-validation

If you don't want to use validation, you may be able to restrict the characters entered by setting up an ngModel and listen on (input) or (beforeinput) events.

But, this isn't really a CLI issue, so I'm closing this. Please consider creating a topic in the Ionic Forum and seeing what others have to say. (I'm not an Angular expert.)

@imhoffd imhoffd closed this as completed Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants