Repository navigation
fix: prevent Tab key from inserting character in TextBox on Skia (backport #22823) (6.7) - #25783
Conversation
…kport #22823) Manual backport of #22823 to release/stable/6.7. 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]>
|
Claude finished @agneszitte's task in 2m 18s —— View job Code Review
SummaryVerdict: LGTM — no blocking issues. The fix is minimal, correctly scoped, and matches WinUI semantics. One informational note posted inline (see below).
|
|
|
||
| Assert.AreEqual(string.Empty, SUT.Text, "Tab should not insert a character in TextBox"); | ||
|
|
||
| // Ensure that Tab key still moves focus to the next control |
There was a problem hiding this comment.
The focus-navigation assertion (Assert.AreEqual(button, focusedElement, ...)) depends on SafeRaiseEvent(UIElement.KeyDownEvent, ...) actually flowing through the focus pipeline (e.g. UnoFocusInputHandler). If that pipeline is not wired into routed-event dispatch on Skia, focus stays on SUT and this assertion would fail deterministically — which would have surfaced in CI on the master PR, so it is probably fine. That said, it is worth confirming with a passing CI run on the backport branch before merge, since any wiring differences between 6.7 and 7.0 could break this assertion silently (making it always fail, or never test what it says it tests).
GitHub Issue: Related to #22818
Backport of #22823 to
release/stable/6.7.PR Type:
🐞 Bugfix
What changed? 🚀
On Skia (macOS, Linux framebuffer, Android), pressing Tab in a
TextBoxinserted a tab character as well as moving focus. WinUI'sTextBoxnever inserts a tab (it has noAcceptsTab). The key-down switch now returns early onVirtualKey.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 inTextBox.skia.cs, so this is a manual port (Mergify can't follow the file move). The runtime testWhen_Tab_Pressed_Should_Not_Insert_Characteris the one from the master PR, unchanged.PR Checklist ✅
🤖 Generated with Claude Code