GitHub user breautek added a comment to the discussion: Disappearing soft 
keyboard in Android app

With the information available I can't really say for certain what the issue is 
but I can share knowledge that can potentially help pinpoint the root issue.

Based on the animated gif, it definitely looks like the input is losing focus, 
just after the window is resized. On Android the document "window" is resized 
when the soft keyboard opens matching the new size of the view port. This is 
part of `adjustResize` behaviour.

## adjustResize vs adjustPan

`adjustPan` is another configuration which causes the native view to pan 
instead of resizing. This means the view will not change in height to make room 
for the keyboard, and instead the entire view will pan. The view is not 
scrollable with this mode, so it can hide content (whereas `adjustResize` gives 
developers the flexibility of creating scrollable views). If `adjustPan` does 
solve the issue, it just simply highlights that the application is resetting 
focus when it shouldn't, either on window resize or orientation change.

These are native configurations, which can should be editable via 
[<edit-config>](https://cordova.apache.org/docs/en/11.x/plugin_ref/spec.html#edit-config)
 directive. I wouldn't call using `adjustPan` a solution, but depending on your 
use case it could be something that is "good enough".

## Node replacement

If you're swapping nodes which some frameworks like (ReactJS) might do 
depending on how the application is doing it's rendering, it might cause the 
behaviour you're seeing. If you're using any UI frameworks like ReactJS, or 
Angular, etc... review their documentation to ensure that they manipulate 
existing nodes rather than a complete replacement. Replacing nodes will cause 
nodes to lose their focus.


GitHub link: 
https://github.com/apache/cordova/discussions/498#discussioncomment-10799678

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscr...@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to