You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mobile): show editing toolbar whenever a soft keyboard is up, not just on phones
The edit bar was gated purely on viewport width (useIsMobile, max-width
767px), so a wide iPad with NO hardware keyboard — where the soft keyboard
does appear — never got the toolbar. Add a width-independent arm: show when
editing AND (narrow OR a soft keyboard is up).
- keyboardViewport: add pan-invariant `softKeyboardPresent(layoutHeight,
vvHeight)` = `layoutHeight - vvHeight >= SOFT_KEYBOARD_MIN_HEIGHT` (150px).
It deliberately omits offsetTop (so it stays true while the page pans/scrolls
with the keyboard up, unlike the positioning overlap) and sits well above the
URL-bar band so a collapsing URL bar can't read as a keyboard. ~0 on
Chromium/Firefox resizes-content (layout shrinks with the keyboard) — fine,
those phones are already covered by the width gate.
- MobileKeyboardToolbar: gate on `isEditing && (isMobile || softKeyboardPresent)`;
detect the keyboard only when `!isMobile` so phones don't pay for it. Extract
the shared subscribe-and-derive pattern (inset + presence) into one generic
`useKeyboardViewportValue` hook.
With a hardware keyboard connected no soft keyboard appears, so the bar stays
hidden — which is the desired behavior. Unit-tested; on-device confirm pending.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments