microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.35k stars 678 forks source link

TextBox MaxLength doesn't work on Win10 w/ "." character #9483

Open Foda opened 7 months ago

Foda commented 7 months ago

Describe the bug

On Windows 10, setting MaxLength on a TextBox doesn't properly limit the "." character. If you set the MaxLength to 5, you can insert a few more than that.

We're seeing this issue pop-up in MAUI: https://github.com/dotnet/maui/issues/19853

Steps to reproduce the bug

  1. Make sure you're on Windows 10 (it works fine in Win11)
  2. Add the following: <TextBox MaxLength="5"/>
  3. Try and add more than 5 "." characters
  4. Observe that more than 5 characters are added

Expected behavior

TextBox should limit the number of characters regardless of which character it is

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.5.1: 1.5.240311000

Windows version

Windows 10 (21H2): Build 19044

Additional context

No response

github-actions[bot] commented 7 months ago

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!

Open similar issues:

Closed similar issues:

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