shelley: Fix Android keyboard covering chat input on Firefox (#48)
Michael Lynch
and
Shelley
created
* Fix Android keyboard covering chat input on Firefox
When the virtual keyboard appears on Android Firefox, it can cover
the chat input field, making it impossible to see what you're typing.
This fix adds two mechanisms to ensure the input stays visible:
1. On focus: scroll the input into view with a small delay to let
the keyboard animation start
2. On viewport resize: use the visualViewport API to detect when
the keyboard changes the viewport size and scroll the input
into view if it's focused
Fixes #47
Co-authored-by: Shelley <shelley@exe.dev>
* Drop the onFocus handler
The visualViewport API should be sufficient
* Restore previous comment
---------
Co-authored-by: Shelley <shelley@exe.dev>