Skip to content

fix: prevent Tab key from inserting character in TextBox on Skia (backport #22823) (6.8) - #25782

Merged
agneszitte merged 1 commit into
servicing/6.8from
dev/agzi/bp-22823-tab-textbox-6.8
Oct 28, 2026
Merged

agneszitte merged 1 commit into
servicing/6.8from
dev/agzi/bp-22823-tab-textbox-6.8

Conversation

@agneszitte

Copy link
Copy Markdown
Member

GitHub Issue: Related to #22818

Backport of #22823 to servicing/6.8.

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia (macOS, Linux framebuffer, Android), pressing Tab in a TextBox inserted a tab character as well as moving focus. WinUI's TextBox never inserts a tab (it has no AcceptsTab). The key-down switch now returns early on VirtualKey.Tab, so focus navigation still happens and no character is inserted.

In 7.0 this switch lives in TextBoxCore.Input.cs; on 6.x it is the same switch in TextBox.skia.cs, so this is a manual port (Mergify can't follow the file move). The runtime test When_Tab_Pressed_Should_Not_Insert_Character is the one from the master PR, unchanged.

PR Checklist ✅

  • 🧪 Runtime test included (from the master PR)
  • ❗ Contains NO breaking changes

🤖 Generated with Claude Code

…kport #22823)

Manual backport of #22823 to servicing/6.8. In 7.0 this switch lives in
TextBoxCore.Input.cs; on 6.x it is the same switch in TextBox.skia.cs,
so the four lines and the runtime test are applied there by hand
(Mergify can't follow the file move).

Related to #22818

Co-authored-by: Martin Zikmund <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @agneszitte's task in 49s —— View job


Review: ✅ Ship it

Verdict: No issues found — this is a clean, faithful backport.

Issues by severity: 0 blocking, 0 minor. No inline comments posted.

Verification performed:

  • Diffed this PR's changes against master PR #22823 directly (gh pr diff 22823) — the TextBox.skia.cs switch-case addition and the When_Tab_Pressed_Should_Not_Insert_Character runtime test are byte-for-byte identical to the master fix, correctly re-targeted from TextBoxCore.Input.cs (7.0 post-refactor location) to TextBox.skia.cs (pre-refactor 6.8 location), as the PR description states.
  • Traced the surrounding OnKeyDownSkia switch in src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.skia.cs:1054-1153: the new case VirtualKey.Tab: return; follows the exact same pattern as the adjacent default branch's return (line 1151) when no character should be inserted — it correctly skips ProcessTextInput/caret-offset logic below the switch, so this is a true root-cause fix (the key is excluded from insertion entirely) rather than a guard bolted on afterward.
  • Confirmed the runtime test's required usings (Microsoft.UI.Xaml.Controls, Windows.System) are already present in Given_TextBox.skia.cs, so no missing-import risk.
  • No DependencyProperty, async/cancellation, or cross-platform-suffix concerns — this is a 4-line, single-platform (.skia.cs) logic addition plus an additive test.
  • Conventional Commit title (fix: ...) is correctly formatted; PR checklist items are accurate.

No further action needed from my side.

@agneszitte
agneszitte merged commit 941f21a into servicing/6.8 Oct 28, 2026
8 of 9 checks passed
@agneszitte
agneszitte deleted the dev/agzi/bp-22823-tab-textbox-6.8 branch October 28, 2026 03:08
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant