This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/platform/web
Johannes Marbach 14ed5fd1e8 Manually adapt UI when keyboard shows or hides on mobile Safari
Mobile Safari seems to be the only browser that does *not* resize the
viewport when the keyboard shows and hides. Instead the window is moved
to make room for the keyboard which moves content at the top off screen.

This uses the VisualViewport API to manually resize the `SessionView`
in response to keyboard display events. Additionally, if a DOM element
exists that has the `bottom-aligned-scroll` CSS class, its scroll
position is retained. Currently this only applies to the `Timeline`.

Note that the VisualViewport API was only introduced with iOS 13.
According to [statista.com], versions below 13 made up for 19% of
all iOS users in summer 2020, with the share continuing to fall off.
As a result, this seems like an acceptable workaround.

Fixes: #181

[statista.com]: https://www.statista.com/statistics/565270/apple-devices-ios-version-share-worldwide/

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2021-03-26 08:29:33 +01:00
..
dom Manually adapt UI when keyboard shows or hides on mobile Safari 2021-03-26 08:29:33 +01:00
ui Manually adapt UI when keyboard shows or hides on mobile Safari 2021-03-26 08:29:33 +01:00
utils move base64/58 encoding into platform 2021-02-12 16:01:54 +01:00
worker c/p error for passing arguments to create_outbound 2020-11-10 18:31:33 +01:00
legacy-polyfill.js extract platform class to put all platform specific code in 2020-10-26 15:44:11 +01:00
LegacyPlatform.js copyright header for legacy platform 2020-11-13 19:05:09 +01:00
Platform.js Manually adapt UI when keyboard shows or hides on mobile Safari 2021-03-26 08:29:33 +01:00
service-worker.js Never close notifs unless clicking them as all browsers only seem to show the last one anyway 2021-03-25 11:13:54 +01:00