Skip to content

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

Merged
agneszitte merged 6 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24556
Sep 28, 2026
Merged

agneszitte merged 6 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-24556

Conversation

@mergify

@mergify mergify Bot commented Sep 24, 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


This is an automatic backport of pull request #24556 done by [Mergify](https://mergify.com).

@mergify mergify Bot added the conflicts Automated merge hit conflicts label Sep 24, 2026
@mergify

mergify Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

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

@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 24, 2026
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.

(cherry picked from commit de751c5)
@ajpinedam
ajpinedam force-pushed the mergify/bp/release/stable/6.7/pr-24556 branch from 16f0983 to 3c237cb Compare September 25, 2026 17:59
@ajpinedam ajpinedam removed the conflicts Automated merge hit conflicts label Sep 25, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam
ajpinedam self-requested a review September 25, 2026 18:54
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 235751 did not find any UI Test snapshots differences.

@mergify

mergify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

@agneszitte
agneszitte merged commit b55c8ae into release/stable/6.7 Sep 28, 2026
48 checks passed
@agneszitte
agneszitte deleted the mergify/bp/release/stable/6.7/pr-24556 branch September 28, 2026 15:47
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.

4 participants