ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
194 stars 178 forks source link

delay to show keyboard after invoking Element.focus() #168

Open CodeWithOz opened 2 years ago

CodeWithOz commented 2 years ago

There's a delay that occurs between when I invoke someDomNode.focus() and when the keyboard's show event is triggered (i.e. when the keyboard itself shows). I've included a performance trace from chrome dev tools to show this.

szoter_annotated_image (7)

The orange rectangle on the left edge is when the touchstart event fires, the blue rectangle is when the click event fires (which is when I invoke node.focus()), and the green is when the keyboard's show event fires. It's usually around 0.5s between the .focus() invocation and the keyboard showing, plus the ~200-300ms it takes to register the click. So it's close to 1s in theory, and in reality it feels like at least 1s between touching the screen and the keyboard showing. Is there something I can do about this? Why the ~500ms before the keyboard comes up? This happens on both higher end and lower end mobile devices.