zoft.MauiExtensions.AutoCompleteEntry icon indicating copy to clipboard operation
zoft.MauiExtensions.AutoCompleteEntry copied to clipboard

Text binding not working on page open

Open zanhk opened this issue 9 months ago • 1 comments

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);
        }
    }

zanhk avatar Apr 09 '25 15:04 zanhk

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.

zleao avatar Apr 17 '25 06:04 zleao