fix: phone app view zoom corrects
This commit is contained in:
@@ -701,6 +701,16 @@
|
|||||||
window.addEventListener("resize", nudgeAppHeight);
|
window.addEventListener("resize", nudgeAppHeight);
|
||||||
window.addEventListener("orientationchange", nudgeAppHeight);
|
window.addEventListener("orientationchange", nudgeAppHeight);
|
||||||
|
|
||||||
|
// A rotation reflows the chat and iOS drops the scroll to mid-history. If we
|
||||||
|
// were pinned to the latest message, snap back there once the layout settles
|
||||||
|
// (re-fire across the reflow since iOS reports stale dimensions mid-rotate).
|
||||||
|
window.addEventListener("orientationchange", () => {
|
||||||
|
const m = document.getElementById("messages");
|
||||||
|
const wasAtBottom = m.scrollHeight - m.scrollTop - m.clientHeight < 90;
|
||||||
|
if (!wasAtBottom) return; // respect the user's scroll-up position
|
||||||
|
[100, 300, 600].forEach((t) => setTimeout(() => { m.scrollTop = m.scrollHeight; }, t));
|
||||||
|
});
|
||||||
|
|
||||||
// Keep the latest message in view when the keyboard opens/closes.
|
// Keep the latest message in view when the keyboard opens/closes.
|
||||||
const userInputEl = document.getElementById("userInput");
|
const userInputEl = document.getElementById("userInput");
|
||||||
userInputEl.addEventListener("focus", () => {
|
userInputEl.addEventListener("focus", () => {
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ body.dark {
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
|
/* Stop iOS from inflating font sizes when the device rotates to landscape (and
|
||||||
|
leaving them big on rotate back). Every other page sets this; the chat didn't. */
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
text-size-adjust: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|||||||
Reference in New Issue
Block a user