-
Notifications
You must be signed in to change notification settings - Fork 766
Description
Describe the bug
Sometimes, the NumberBox control (Microsoft.UI.Xaml.Controls.NumberBox
) will not properly take input from the keyboard. This happens after focusing the control, especially the first time the control is focused after it is given a value. When this bug occurs, the only way to get the control to accept input is either to un-focus and re-focus the control, or to use the arrow keys to move the cursor.
Steps to reproduce the bug
I've found that this works best for applications that have been launched recently. It is more difficult (but not impossible) to reproduce a second or third time, even if the NumberBox is a different instance.
NB: This bug does not occur every time, but it is by no means rare.
- Locate a NumberBox (e.g. in the WinUI 3 Gallery, winui3gallery://item/NumberBox)
- If the NumberBox does not already have a value, enter a value
- Un-focus the NumberBox
- Re-focus the numberbox
- Attempt to modify or delete the contents of the box
Expected behavior
The highlighted value in the NumberBox should be overwritten by the number that was inputted to the box.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (23H2): Build 22631
Additional context
Bug has been present since at least WinAppSDK 1.6.240923002 (also tested in the latest, 1.6.241114003). I have been unable to reproduce it with WinUI 2.
Other factors considered:
- Appears on both .NET 8 and .NET 9
- Appears in both production and release
- Appears in several different apps from different publishers
- Appears across different machines running different Windows versions (Enterprise, Pro, etc)