Repository navigation
Fix iPad layout stuck short after a keyboard search - #407
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: nonewhile#searchInputstill has focus. iPad WebKit dismisses the keyboard but fires noblur/focusout, anddocument.activeElementstays on the hidden input.panel-anchor.jsholds 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 adisplay: nonesubtree 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
panel-anchor.test.js: a focused input whose container goesdisplay: nonewithout 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.touch.jshid the panel without blurring) is fixed here.🤖 Generated with Claude Code