Repository navigation
fix(ask): keep the keyboard up while an option is pressed during Other typing - #255
Merged
andrebrait merged 11 commits intoOct 13, 2026
Merged
Conversation
…r typing kahme247#252 kept focus in the Other text box only for footer taps. Tapping an option row moved focus too, so on Android Chrome the keyboard closed and the panel resized before the click, and the first tap missed the option. On touch, the panel now prevents mousedown's focus change anywhere outside a text field while one of its text fields has focus. A tapped label still focuses its radio once the click lands, so the keyboard closes after the choice is made, not before. A mouse keeps normal press behavior (text selection, radio arrow keys). Tapping back into kept Other text fires no focus event any more, so a click re-chooses Other as well.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (77afab1) onto upstream/main.
The composer is hidden while an ask is open but kept its focus, so the phone keyboard opened for the composer stayed up. The first tap in the ask panel then blurred it, closing the keyboard and resizing the panel before the click, which missed its target. Blur the hidden composer as the ask opens.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (956b6bd) onto upstream/main.
useMobileInputOpen treated any focus inside the panel on a touch device as an open keyboard, so tapping an option (Android focuses the radio) switched the panel to the visible-area height under the finger and the tap missed. Only a focused text field raises a keyboard.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (03ae679) onto upstream/main.
…en option Codex review on kahme247#255: - The pointer media query describes only the primary pointer. A touch tap on a mouse-primary laptop skipped the guard, and a mouse on a touch-first device lost text selection. Read pointerType from the press's pointerdown instead (touch and pen are guarded, mouse is not). - With the guard, a tap on the radio itself (not its label) left focus in Other, so the keyboard stayed up and further typing re-chose Other. Focus the option when it changes.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (171ff22) onto upstream/main.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (171ff22) onto upstream/main.
… while typing Found testing on Android Chrome: - Submit kept the Other text box focused (the press guard) until omp acknowledged the answer and the 250ms hand-off ended, so the keyboard lingered. Release the panel's focus as the answer is sent. - Collapsing the keyboard (back button) keeps the text box focused, so the next tap raised the keyboard again for a moment. When the visible area grows back while a panel text field has focus, blur it.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (5649b80) onto upstream/main.
Codex review on kahme247#255: with interactive-widget: resizes-content (our viewport meta) Android shrinks the layout viewport along with the visual one, so visualViewport.height < innerHeight - 120 never held and the keyboard-collapse blur never fired there. Compare the visible height to the tallest seen at the current width instead; a width change (rotation) starts over.
Codex review on kahme247#255: a width change reset the height baseline but kept keyboardWasOpen, so rotating with the keyboard up looked like a collapse and blurred the field mid-typing.
Codex review on kahme247#255: clearing keyboardWasOpen on a width change avoided the false collapse but forgot the open keyboard, so its real collapse afterwards was never seen. Track the keyboard by its own lowest height: it closes when the visible area rises well above that, which a rotation re-bases without dropping the open state.
Codex review on kahme247#255: on a fine-pointer desktop, shrinking the window by more than 120px (or docking dev tools) looked like a keyboard opening, and regrowing it blurred the focused field. Run the height history only where a soft keyboard exists; a keyboard overlaying the page (visual viewport below the layout one) still caps the panel on any device.
Codex review on kahme247#255: on a touchscreen laptop the primary pointer is fine, so a touch tap's soft keyboard was neither capped for nor tracked. Use the pointerType of the latest press, falling back to the primary pointer query before any press, as the focus guard already does.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 13, 2026
…essed during Other typing Squashed from origin/fix/ask-option-tap-keeps-keyboard (1734bdd) onto upstream/main.
…oard # Conflicts: # CHANGELOG.md
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.
Problem
Follow-up to #252, found testing it on Android Chrome. While typing in a question's Other box, tapping an option still did not choose it on the first tap. The tap moved focus off the text box, so the keyboard closed and the panel resized before the click, and the click missed the option. #252 only guarded the footer buttons.
Changes
(pointer: fine)absent, the file's existingtouchPointer()): a mouse keeps text selection and radio arrow-key navigation.Verification
npm test: 1401 pass, 0 fail.tsc --noEmitand eslint clean.