简体   繁体   中英

calling .focus() on <input type=“text”> in WKWebView causes keyboard lag

I'm building an app in HTML5 and Javascript using WKWebView.

I have a very plain text input that I want to call focus() on manually via javascript. It does work, the keyboard pops up and there is a cursor in the input however the iOS keyboard is very laggy when typing/deleting the first character. It takes over a second for the character to appear and for the keyboard to become interactive again.

Does anyone have any idea on how what the problem might be?


Try using click() instead of focus(). Both will give you the same response provided u dont have any events attached to onclick of the text box.

我们在带有WKWebview的AngularJS应用程序中遇到了类似的问题,我们通过使用ng-click事件而不是ng-focus解决了此问题(仅在iOS上)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM