Repository navigation
fix(nextjs): stop hidden dialogs raising the phone keyboard on load - #60
Merged
Merged
Conversation
Opening /explorer on a phone brought up the on-screen keyboard. The "Add folder / file / list" and "New Sort" dialogs stay mounted while closed, and their Name inputs used React's autoFocus, which focuses on mount, not on open. So at page load the hidden "Enter file name" input took focus (reproduced on app.efs.eth.limo at phone size). Both dialogs now focus their Name input when they open instead. The List name input keeps autoFocus because it only mounts once the dialog is open as a List. The other autoFocus uses in the explorer (inline label/description edits, the mirror URI field) mount on a user action, so they're left alone. Verified on the dev server pointed at Sepolia at phone size: nothing is focused after load; + Add -> Folder, File and List each focus their Name field; New Sort focuses its name field. Type check, eslint and prettier pass on both files. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Claude Opus 5.5 <noreply@anthropic.com> Tested-by: Claude Opus 5.5 <noreply@anthropic.com> Permanence-tier: Ephemeral
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
autoFocus./explorerno longer brings up the on-screen keyboard.Why
Both dialogs stay mounted while closed. daisyUI's
.modaloverrides the UAdialog:not([open]) { display: none }withdisplay: grid; opacity: 0, so the closed dialogs' inputs stay focusable. React'sautoFocusfocuses on mount, so at page load the hidden "Enter file name" input took focus and the phone raised its keyboard. Reproduced on app.efs.eth.limo at phone size:document.activeElementwas that hidden input.The List name input keeps
autoFocus: it only mounts once the dialog is open as a List. The otherautoFocususes in the explorer (inline label/description edits, the mirror URI field,InputBase's opt-inreFocus) mount on a user action, so they are unchanged.Permanence tier
Ephemeral (
packages/nextjsdebug UI).Specs / ADRs touched or checked
Test plan
/explorerloads. Live site before the fix: the hidden file-name input is focused.yarn next:lint,yarn hardhat:lint,yarn next:check-types,yarn docs:check, nextjs unit tests (184 pass).Review notes (P3, not changed here): closed daisyUI dialogs are still reachable with Tab / the mobile "next" key because of the
display: gridoverride; addinginertto closed dialogs would fix it.CreateSortModalhas noonCancel, so Escape closes it natively while the parent keepsisOpen; re-open still works. Both predate this PR.Agents involved
🤖 Generated with Claude Code