Skip to content

Fix iPad layout stuck short after a keyboard search - #407

Merged
lstein merged 1 commit into
masterfrom
lstein/fix/ipad-search-keyboard-strand
Sep 29, 2026
Merged

lstein merged 1 commit into
masterfrom
lstein/fix/ipad-search-keyboard-strand

Conversation

@lstein

@lstein lstein commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

On iPad, running a keyword search with Return on the on-screen keyboard left the layout stuck at the keyboard-reduced height. Rotating and fullscreen round trips did not help; only a reload, or focusing the field again and dismissing the keyboard, restored it.

Cause: the search hides the dialog with display: none while #searchInput still has focus. iPad WebKit dismisses the keyboard but fires no blur/focusout, and document.activeElement stays on the hidden input. panel-anchor.js holds its viewport correction while a text field is focused, so the hold never ended and every resync (resize, rotate, fullscreen) returned early.

Fix:

  • panel-anchor.js: a focused text entry inside a display: none subtree no longer counts as focused. It is blurred and the usual 700ms keyboard-collapse hold applies before recomputing. This also covers any other dialog that hides itself with a field still focused.
  • search-ui.js / touch.js: every path that hides the text search dialog (successful search, close button, toggle, outside click, iPad outside tap) blurs its inputs first.

Test plan

  • New Jest case in panel-anchor.test.js: a focused input whose container goes display: none without a blur is released and the layout recomputes after the collapse delay. It fails without the fix.
  • npm test: 918 passed; eslint and prettier are clean.
  • Tested by the author on iPad: the layout recovers after a Return-submitted search.
  • Adversarial fresh-context review. The one live gap it found (the iPad outside tap in touch.js hid the panel without blurring) is fixed here.

🤖 Generated with Claude Code

Pressing Return in the text search hides the dialog with display: none
while its input still has focus. iPad WebKit dismisses the keyboard but
fires no blur, so document.activeElement stays on the hidden input and
panel-anchor.js held its viewport correction forever — rotation and
fullscreen could not clear it, only a reload or a second focus/blur.

panel-anchor.js now treats a focused field inside a display: none
subtree as blurred: it blurs it and waits out the keyboard collapse like
any other blur. The search dialog's close paths (successful search, close
button, toggle, outside click and the iPad outside-tap in touch.js) also
blur their inputs before hiding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lstein
lstein merged commit fb52db4 into master Sep 29, 2026
10 checks passed
@lstein
lstein deleted the lstein/fix/ipad-search-keyboard-strand branch September 29, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant