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.
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. |
MrJul
left a comment
There was a problem hiding this comment.
A few minor points and this is good to go!
|
You can test this PR using the following package version. |
What does the pull request do?
Add a
ShowSuggestionsproperty toTextInputOptionsthat 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
ShowSuggestionsproperty is set tofalse.Checklist
Breaking changes
Fixed issues
Fixes #16579