Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberBox will sometimes not respond to input from the keyboard #10286

Open
jb-bcl opened this issue Jan 9, 2025 · 6 comments
Open

NumberBox will sometimes not respond to input from the keyboard #10286

jb-bcl opened this issue Jan 9, 2025 · 6 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@jb-bcl
Copy link

jb-bcl commented Jan 9, 2025

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.

  1. Locate a NumberBox (e.g. in the WinUI 3 Gallery, winui3gallery://item/NumberBox)
  2. If the NumberBox does not already have a value, enter a value
  3. Un-focus the NumberBox
  4. Re-focus the numberbox
  5. 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)
@jb-bcl jb-bcl added the bug Something isn't working label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 9, 2025
@jb-bcl
Copy link
Author

jb-bcl commented Jan 9, 2025

Suggested issue (#5614) is not a duplicate or particularly relevant.

@jb-bcl
Copy link
Author

jb-bcl commented Jan 9, 2025

Image

Example behaviour with Keyviz used to show key presses

@karkarl
Copy link
Contributor

karkarl commented Jan 13, 2025

Can you write out what specific keyboard inputs you are doing to repro this issue? I am unable to simply using tab and shift + tab to focus and unfocus. If you can provide a time travel trace for the repro that will be even better.

@karkarl karkarl added needs-author-feedback Asked author to supply more information. and removed needs-triage Issue needs to be triaged by the area owners labels Jan 13, 2025
@tpoint75
Copy link

Is it duplicate to this #10223 ?

@jb-bcl
Copy link
Author

jb-bcl commented Jan 13, 2025

Not duplicate to #10223 - that issue describes the rest of the UI freezing after changing the NumberBox with the arrow keys, this one is about the NumberBox not accepting most keyboard input.

@karkarl - I've created a minimal reproducible example at https://github.com/jb-bcl/microsoft-ui-xaml-10286. I've been using the mouse to focus the NumberBox, finding most success when clicking between the visible value and the space where the "X" button will appear; then, pressing any number key (number row, number pad, etc), backspace, or any other key other than the left arrow. It doesn't happen every time, so it might take a good few tries to get the repro to happen.

I've tried to create a time travel trace, but I've been unable to reproduce it while ttd.exe is attached to the process (trying on this repro, the winUI3 gallery, and even the codebase where I first encountered this issue, though that one I would be unable to share). TTD seems to make all WinUI apps quite slow, perhaps that's related.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-triage Issue needs to be triaged by the area owners and removed needs-author-feedback Asked author to supply more information. labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

3 participants