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

Made MaxLength property consistent across all platforms #5581

Merged
merged 7 commits into from
Apr 5, 2022

Conversation

rachelkang
Copy link
Member

Description of Change

MaxLength property is now consistent across Windows, Android, and iOS for Entry, Editor, and SearchBar! yayyyy :)

MaxLength=-1 behaves as MaxLength=int.MaxValue
MaxLength=0 fields cannot be typed into
MaxLength>0 limits and trims text to the assigned value

Issues Fixed

Fixes #678

@rachelkang rachelkang requested review from PureWeen, Redth, hartez and mattleibow and removed request for PureWeen March 25, 2022 20:28
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Just got some questions on how changing the properties affect the others. Maybe we can add a test for this case where toggling the two around does not inadvertently change values.

Comment on lines +102 to +103
if (maxLength == 0)
MauiAutoSuggestBox.SetIsReadOnly(platformControl, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the text box below, does it re-enable after reverting MaxLength?

Comment on lines +131 to +132
if (maxLength == 0)
textBox.IsReadOnly = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if I set MaxLength to 0 nd then back to 10? Does it re-enable?

@Redth
Copy link
Member

Redth commented Mar 25, 2022

Tested iOS/MacCatalyst, working as expected, lgtm on those platforms!

@Redth Redth added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Mar 25, 2022
@rachelkang
Copy link
Member Author

AFAICT failing tests are unrelated

@rachelkang
Copy link
Member Author

Windows SearchBar MaxLength will need some more time #5669

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions to make sure we are testing the combinations of properties.

@mattleibow mattleibow merged commit 4d9c3a4 into main Apr 5, 2022
@mattleibow mattleibow deleted the fix-maxlength-property branch April 5, 2022 00:22
@mattleibow mattleibow added this to the 6.0.300-rc.2 milestone Apr 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.300-rc.2 Look for this fix in 6.0.300-rc.2! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-6.0.300-rc.2 Look for this fix in 6.0.300-rc.2! legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] The Entry.MaxLength value is inconsistent
4 participants