Skip to content

fix(wasm): Size the invisible text input to the content area - #24556

Merged
ajpinedam merged 6 commits into
unoplatform:masterfrom
ajpinedam:dev/ajp/wasm-invisible-input-size
Sep 21, 2026
Merged

ajpinedam merged 6 commits into
unoplatform:masterfrom
ajpinedam:dev/ajp/wasm-invisible-input-size

Conversation

@ajpinedam

@ajpinedam ajpinedam commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: Tracked internally.

PR Type:

🐞 Bugfix

What changed? 🚀

The invisible <input /> the WASM head keeps in the DOM for text entry was sized and positioned from TextBoxView.DisplayBlock. The DisplayBlock shrink-wraps the text, so the element tracked the text rather than the field.

This was latent for a long time, because the TS wrote a unitless value:

input.style.width = `${width}`;    // invalid CSS, silently dropped

Once the unit was added, the sizing took effect and the element started growing by a character's width on every keystroke. Browser password managers bind to that <input /> (it carries type="password" and autocomplete="password") and anchor their affordances to its bounds — so the badge sat at the left edge of an empty PasswordBox and marched right as the user typed.

UpdateSize and UpdatePosition now track the ContentElement minus its padding, which is what OverlayTextBoxViewExtension already does on the other Skia targets. Moving the position to the same anchor keeps the element on its field when long text scrolls horizontally or TextAlignment shifts the DisplayBlock.

Adding the CSS unit was correct and is left as-is — it only exposed this.

Verification

Measured the real #uno-input bounds in Chrome against SamplesApp's search TextBox, typing 10 characters. Identical builds, only this change differing:

characters typed before after
0 1px 216px
1 12px 184px
5 56px 184px
10 110px (+11px/char) 184px (flat)

The one-time 216 → 184 step after the first character is the DeleteButton appearing on the focused non-empty TextBox, which genuinely narrows the ContentElement. It happens once, not per character.

The added runtime test was confirmed to fail without the fix (expected value <182> and actual value <1>) and pass with it.

PR Checklist ✅

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 18, 2026 21:58
@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia labels Sep 18, 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 review overview

🟡 Changes recommended

The overlay positioning has an unresolved RTL issue, and the position behavior lacks regression coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Updates the WASM invisible text input to follow the TextBox content area instead of shrink-wrapped text, with runtime coverage for stable sizing during typing.

Changes:

  • Sizes and positions the browser input from ContentElement.
  • Adds a WASM runtime test validating width stability.
File Description
BrowserInvisibleTextBoxViewExtension.cs Updates invisible input sizing and positioning.
Given_TextBox.skia.cs Adds DOM-based WASM regression coverage.

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings September 18, 2026 22:26

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 review overview

🟡 Changes recommended

The new runtime tests do not clean up WindowContent, allowing focused DOM state to leak into subsequent tests.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 234612 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
  • skia-windows-screenshots: 2310 changed over 2408

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AnimatedIconPage.png
    • Attributed_text_FontSize_Changing.png-dark
    • Accessibility_ScreenReader.png-dark
    • AndroidWindowInsets.png
    • AppBarToggleButtonTest.png
    • AppBarButtonWithIconTest.png
    • AutoBorderStretchwithtopmargin.png-dark
    • AppBarButtonTest.png-dark
    • AppBar_KeyBoard.png-dark
    • AppWindowClosing.png-dark
    • ApplicationViewSizing.png-dark
    • AutoSizedPathCentered.png-dark
    • ApplicationViewMode.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowPresenters.png
    • AppWindowFeatures.png-dark
    • AutoSuggestBox_Description.png
    • AppWindowFeatures.png
    • AppWindowPositionAndSize.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background

These tests were written before master gained a per-host placement policy
for the shared invisible <input />. Rebasing them on top of it left them
asserting tracking geometry unconditionally, which iOS hosts (input parked
off-screen, size and position ignored) and any session where accessibility
has detached the input would both fail.

Reuse the probe helpers master already has instead of a second copy, and
skip where there is deliberately nothing to measure — both policies are
pinned by When_Focused_In_Browser_Then_Hidden_Input_Placement_Matches_Host.
@ajpinedam
ajpinedam force-pushed the dev/ajp/wasm-invisible-input-size branch from 2544cd3 to de751c5 Compare September 21, 2026 15:27
Copilot AI review requested due to automatic review settings September 21, 2026 15:27

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 review overview

🟡 Changes recommended

The tests can inspect a stale shared input if focus acquisition fails, so focus ownership must be asserted.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings September 21, 2026 15:54

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 review overview

🟢 Approval recommended

The implementation aligns with existing overlay behavior and the tests cover the affected sizing and positioning scenarios.

Review effort: Lite
Findings: None

Resolved since last review (1)

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 234798 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Focus_FocusVisual_Properties.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • Examples.png-dark
  • skia-windows-screenshots: 2310 changed over 2440

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AnimatedIconPage.png-dark
    • AppBarButtonTest.png-dark
    • AppBarButtonWithIconTest.png-dark
    • AppBar_KeyBoard.png
    • ApplicationViewMode.png
    • ApplicationViewSizing.png
    • AppWindowFeatures.png-dark
    • AppWindowPositionAndSize.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AppWindowTitleBar Properties.png
    • Attributed_text_FontSize_Changing.png-dark
    • Attributed_text_FontSize_Changing.png
    • Attributed_text_Simple.png
    • AutoBorderStretchwithbottommargin.png
    • AutoBorderStretchwithleftmargin.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_Name.png-dark
    • AutomationProperties_AutomationId.png
    • AutomationProperties_Name.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background

@mergify

mergify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ajpinedam
ajpinedam merged commit f5b626d into unoplatform:master Sep 21, 2026
52 checks passed
@ajpinedam

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport servicing/6.8

@mergify

mergify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8

✅ Backports have been created

Details

Cherry-pick of bdbb268 has failed:

On branch mergify/bp/servicing/6.8/pr-24556
Your branch is up to date with 'origin/servicing/6.8'.

You are currently cherry-picking commit bdbb268.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/UI/Xaml/Controls/TextBox/BrowserInvisibleTextBoxViewExtension.cs

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of c7e93ab has failed:

On branch mergify/bp/servicing/6.8/pr-24556
Your branch is ahead of 'origin/servicing/6.8' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit c7e93ab.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/UI/Xaml/Controls/TextBox/BrowserInvisibleTextBoxViewExtension.cs

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@ajpinedam
ajpinedam deleted the dev/ajp/wasm-invisible-input-size branch September 21, 2026 17:56
ajpinedam added a commit that referenced this pull request Sep 23, 2026
…r-24556

fix(wasm): Size the invisible text input to the content area (backport #24556)
@ajpinedam

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

Cherry-pick of bdbb268 has failed:

On branch mergify/bp/release/stable/6.7/pr-24556
Your branch is up to date with 'origin/release/stable/6.7'.

You are currently cherry-picking commit bdbb268.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/UI/Xaml/Controls/TextBox/BrowserInvisibleTextBoxViewExtension.cs

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of c7e93ab has failed:

On branch mergify/bp/release/stable/6.7/pr-24556
Your branch is ahead of 'origin/release/stable/6.7' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit c7e93ab.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/Uno.UI.Runtime.Skia.WebAssembly.Browser/UI/Xaml/Controls/TextBox/BrowserInvisibleTextBoxViewExtension.cs

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

agneszitte added a commit that referenced this pull request Sep 28, 2026
…6.7/pr-24556

fix(wasm): Size the invisible text input to the content area (backport #24556)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia 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.

5 participants