I’m developing a chat application using .NET MAUI.
On Android I load the chat UI inside a WebView.
The chat works fine in a normal mobile browser (Chrome):
when the user taps the message input, the keyboard appears and the input moves up correctly so it stays visible.
However, inside the MAUI WebView the behavior is different:
-
When the keyboard opens, the input gets pushed too far up leaving a large empty space, or
-
The keyboard overlaps the input, making it impossible to see what the user is typing.
So the layout handling with the soft keyboard is not matching the behavior of Chrome.
What I need to achieve
I want the WebView to resize or adjust like a normal browser so the input stays just above the keyboard.
Questions
-
Is there a recommended way in .NET MAUI to handle the Android soft keyboard with WebView?
-
Should this be fixed on the MAUI side (windowSoftInputMode / platform-specific code) or via CSS/JavaScript inside the page?
-
How can I properly inject JavaScript into the MAUI WebView to handle viewport/keyboard resizing?