zoft.MauiExtensions.AutoCompleteEntry
zoft.MauiExtensions.AutoCompleteEntry copied to clipboard
Text binding not working on page open
When i open the page "With bindings" on ios I would expect the text "Port" to be visible on the page but instead it's not,
That's because handler?.PlatformView?.UpdateSelectedSuggestion(autoCompleteEntry); is being called even if no suggestion has been selected and that cause the text to reset to null.
To fix you could simply check if the SelectedSuggestion is not null before updating
/// <summary>
/// Map the SelectedSuggestion value
/// </summary>
/// <param name="handler"></param>
/// <param name="autoCompleteEntry"></param>
public static void MapSelectedSuggestion(IAutoCompleteEntryHandler handler, AutoCompleteEntry autoCompleteEntry)
{
if (autoCompleteEntry.SelectedSuggestion != null)
{
handler?.PlatformView?.UpdateSelectedSuggestion(autoCompleteEntry);
}
}
Thanks for the feedback. I'm currently with no access to a PC. I'll try to have a look by the end of next week, when I have some 'free' time.