Windows SearchBar MaxLength > 0 not working properly #5669
Labels
area-controls-entry
Entry
p/2
Work that is important, but is currently not scheduled for release
platform/windows 🪟
t/bug
Something isn't working
Milestone
Description
On Windows, the platform control AutoSuggestBox does not have a built-in property for MaxLength
Therefore, we are having some issues with getting MaxLength to fully work for SearchBar on Windows. For MaxLength > 0, any preassigned text gets truncated by our substring logic - however, it does not limit the searchbar itself and text greater than the assigned maxlength can still be inputted.
Creating an attached property (as was done with this control for IsReadOnly did not make a difference.
Steps to Reproduce
<SearchBar Text="1 SearchBar text" MaxLength="1" />
to the MainPage.xamlVersion with bug
Release Candidate 1
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
all
Did you find any workaround?
A potential workaround is calling UpdateMaxLength() every time the text is updated
However, this is not ideal and is very laggy/glitchy, having the appearance of text being deleted after the fact
Relevant log output
No response
The text was updated successfully, but these errors were encountered: