-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: add hidesuggestions property to textbox #17815
Conversation
You can test this PR using the following package version. |
|
@cla-avalonia agree |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
API diff for review: namespace Avalonia.Input.TextInput
{
public class TextInputOptions
{
+ public static readonly AttachedProperty<System.Boolean> HideSuggestionsProperty;
+ public System.Boolean HideSuggestions { get { throw null; } set { } }
+ public static System.Boolean GetHideSuggestions(StyledElement avaloniaObject) { throw null; }
+ public static void SetHideSuggestions(StyledElement avaloniaObject, System.Boolean value) { }
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes from the API review meeting:
The default behavior varies by platform: suggestions are enabled by default on mobile and disabled on desktop. This requires a default state, with a nullable boolean, and null
being the default value.
Plus, the negative name isn't ideal, so we chose to go with ShowSuggestions
instead.
Expected API:
public class TextInputOptions
{
public static readonly AttachedProperty<bool?> ShowSuggestionsProperty;
public bool? ShowSuggestions { get; set; }
public static bool? GetShowSuggestions(StyledElement);
public static void SetShowSuggestions(StyledElement, bool?);
}
You can test this PR using the following package version. |
API updated according to specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor points and this is good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
You can test this PR using the following package version. |
What does the pull request do?
Add a
ShowSuggestions
property toTextInputOptions
that when set to false on a text box, the keyboard does not show the autocomplete/word suggestions above the keyboard on Android/iOS.What is the updated/expected behavior with this PR?
Android/iOS keyboards do not present suggestions when the new
ShowSuggestions
property is set tofalse
.Checklist
Breaking changes
Fixed issues
Fixes #16579