Entry should use NumberBox on Windows when keyboard property is numeric
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
.NET MAUI should use NumberBox on Windows for any Entry control that has the Keyboard property set to numeric. Currently it isn't possible to prevent users from inputting non-numeric characters in an Entry control on Windows but it is possible on Android. I don't believe this behavior should be inconsistent between Operating Systems. The keyboard property should result in consistent behavior regardless of OS.
I am happy to elaborate on why I need this if needed.
### Public API Changes
Ideally it should check if an Entry control has a property "keyboard" set to "Numeric" and then instead of using a TextBox on Windows it should use `Microsoft.UI.Xaml.Controls.NumberBox`.
### Intended Use-Case
I have an app that accepts barcodes as an input and although on Android it works as intended (only accepting numeric values), it doesn't prevent a user from entering non-numeric characters on Windows. It defeats the purpose of my app being able to be used cross-platform. I know that users will accidentally type in letters in my input and I want to prevent that from happening.
Contributor guide
Research direction
Start by tracing how .NET MAUI Entry controls are mapped to native Windows controls and how the Keyboard property is handled for numeric input. Compare the Windows behavior with the Android implementation and investigate the Microsoft.UI.Xaml.Controls.NumberBox integration. Done means numeric Entry controls prevent non-numeric input on Windows while other keyboard modes retain their existing behavior, with tests covering the mapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100