Skip to content

fix(wasm): Keep popups open when the soft keyboard hides - #25387

Open
MartinZikmund wants to merge 4 commits into
masterfrom
dev/mazi/wasm-keyboard-lightdismiss
Open

MartinZikmund wants to merge 4 commits into
masterfrom
dev/mazi/wasm-keyboard-lightdismiss

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #25380

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia WebAssembly in Edge on Android, hiding the soft keyboard also closed open flyouts and overlay SplitView/NavigationView panes.

Cause: when the keyboard hides, Edge re-lays out the page before it re-attaches its bottom toolbar. The layout viewport briefly grows by the toolbar height (793 → 845 CSS px on the test device) and returns about 130ms later. The text input stays focused the whole time. WebAssemblyWindowWrapper passed that blip on as a real window resize, so WinUI's resize rules dismissed everything:

  • XamlRoot.Changed → PopupRoot.CloseLightDismissablePopups closed the flyouts.
  • The SplitView height changed → OnSizeChanged → TryCloseLightDismissiblePane closed the pane.

Fix: while the soft keyboard occludes the visual viewport, or within 1s after it hides, a change that only affects the height is reported to the managed window once it has held for 300ms. A blip that reverts within that window is never reported. Everything else is reported immediately, as before: width changes, rotations, and any resize without a soft keyboard. That includes dragging a desktop browser's bottom edge, or docking DevTools, while a TextBox has focus.

Validation:

  • Device: Edge 155 on Android, dismissing the keyboard with the chevron and with Back. Instrumented logs show the 845px blip held back, and the pane stays open until a real outside tap. iOS Safari 27 never fires a layout resize around the keyboard (only the visual viewport changes), so it's unaffected either way.
  • Runtime tests (Skia WASM, headless Chromium): Given_InputPane.When_Viewport_Blips_As_Soft_Keyboard_Hides_Then_* replay the blip. They fail without the fix (both the pane and the flyout close) and pass with it. The tests replay Edge's sequence through a stand-in visualViewport: keyboard shown, keyboard hidden, then the blip. When_Viewport_Height_Changes_With_Soft_Keyboard_Then_Window_Resized_Once_Settled checks that a lasting height change still reaches the window. When_Viewport_Height_Changes_During_Text_Entry_Without_Soft_Keyboard_Then_Window_Resized_Immediately covers desktop resizing while a TextBox has focus. That test fails with a focus-only gate.
  • Runtime tests (Skia desktop): When_OccludedRect_Cleared_Then_* check that the shared InputPane occlusion path (keyboard shown, then cleared) leaves an overlay pane and a flyout open.

PR Checklist ✅

🤖 Generated with Claude Code

MartinZikmund and others added 2 commits October 13, 2026 08:43
Hiding the soft keyboard, Edge on Android briefly grows the layout
viewport before its toolbar settles back. The transient resize reached
the window and light-dismissed open flyouts and overlay panes. Height-only
changes during text entry are now reported once settled.

Fixes #25380

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replays Edge's transient viewport growth during text entry and checks
an overlay SplitView pane and a Flyout stay open, while a lasting height
change still reaches the window. Also covers the shared InputPane
occlusion path showing and clearing with both open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@MartinZikmund MartinZikmund added the kind/bug Something isn't working label Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:10
@MartinZikmund MartinZikmund added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts kind/bug Something isn't working labels Oct 13, 2026
@MartinZikmund MartinZikmund self-assigned this Oct 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 16s —— View job


Review summary

Verdict: ship, with one non-blocking suggestion.

  • Root cause (Edge's transient layout-viewport growth) is addressed at the source, in the layer that forwards the resize, rather than by guarding the popup/SplitView dismissal paths. This is a root-cause fix.
  • Tests cover red/fix/green: the WASM runtime tests replay the blip and also check that a lasting height change still reaches the window. There are no skipped or ignored tests.
  • Style conventions (braces, tabs, no event Action) are respected.

Issues: 0 blocking, 1 minor (inline, on the deferral also applying to height shrink).

I reviewed by inspection only. I did not build or run anything.

if (last
&& rect.width === last.width
&& rect.height !== last.height
&& document.activeElement?.id === UnoDomIds.input) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side effect worth noting: this defers every height-only change while the input is focused, including the legitimate shrink when the soft keyboard shows (on browsers using resizes-content). The app's layout then lags the keyboard by 300ms, so the focused TextBox may be briefly covered before it's scrolled into view. Consider limiting the deferral to height growth (rect.height > last.height), since the blip is a growth and a shrink is never the toolbar artifact. Otherwise, please confirm on a device that the show path isn't visibly delayed.

MartinZikmund and others added 2 commits October 13, 2026 09:28
Gating on the focused text input also delayed height-only resizes of a
desktop browser window (dragging its bottom edge, docking dev tools) while
a TextBox had focus. Resizes are now only held back while the soft keyboard
occludes the viewport or shortly after it hides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The blip tests now simulate the keyboard showing and hiding through the
visual viewport, as Edge does, and a new test checks that a height-only
resize during text entry without a soft keyboard reaches the window
immediately.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 15s —— View job


Review summary

Verdict: ship. 0 blocking issues, 2 minor notes. I reviewed by inspection only and did not build or run anything.

  • Root cause: the change sits in WebAssemblyWindowWrapper.ts, where the transient Edge viewport growth is forwarded as a resize. It does not add guards to the popup or SplitView dismissal paths. That is a root-cause fix.
  • Tests: the WASM runtime tests replay the blip and also check that a lasting height change still reaches the window. The desktop tests cover the shared InputPane occlusion path. Nothing is skipped or ignored.
  • Style: braces, tabs and EventHandler use all follow the repo conventions.

Notes

  1. Stale PR description. The description says the deferral applies "while #uno-input is focused". The code now uses isSoftKeyboardTransition(), which is true while the last reported occlusion is above 0 or within 1000ms of it returning to 0. Please update the description so it matches the code.
  2. Show path on resizes-content browsers. The earlier review concern about delaying the keyboard-show shrink looks mostly resolved. A shrink is only deferred once occlusion has been reported above 0. Any height-only change while the keyboard is up is also deferred by 300ms. This is acceptable, but it has not been confirmed on a device. Also, lastReportedSize is only set in reportSize, so the first height-only change after startup is reported immediately. That is harmless.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239127 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png-dark
    • AppWindowFeatures.png
    • AppXamlDefinedResources.png
    • Attributed_text_Simple.png
    • AutoBorderStretchwithleftmargin.png
    • AutomationProperties_Landmark.png
    • AutoSizedPathCentered.png
    • AutoSizedTopLeft.png-dark
    • BackGesture.png-dark
    • BackGesture.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • Battery.png-dark
    • Battery.png
    • BezierSegment.png-dark
    • BezierSegment.png
    • BitmapIcon_Sizing.png-dark
    • BitmapIcon_Sizing.png

@MartinZikmund MartinZikmund added the 7.1 PRs only. For issues, use the Release field. label Oct 14, 2026
@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.1 PRs only. For issues, use the Release field. area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WASM Skia] Dismissing the mobile soft keyboard also closes open flyouts/popups/overlay panes

4 participants