Hey,
I'm having a problem with auto complete control for Maui (this is Windows desktop app). In our app we have a view caching system which basically makes it a SPA application (what we do is we change the Contnet property dynamically of the container that should contain our views). The problem is as follows. Whenever we navigate between any view and back to the view where autocomplete resides, the keyboard navigation is treated as if it was attached once more (that's my assumption) - meaning that when we did one cycle of navigation (go to another view and back), trigger auto completion and press arrow down on keyboard it jumps two records down instead of one. The problem is incremental so when we do for example 4 cycles of navigation and press arrow down key, we jump 4 items down and the 4th item is highlighted.
Unfortunately i cannot provide more than the control initialization.
I'm having a problem with auto complete control for Maui (this is Windows desktop app). In our app we have a view caching system which basically makes it a SPA application (what we do is we change the Contnet property dynamically of the container that should contain our views). The problem is as follows. Whenever we navigate between any view and back to the view where autocomplete resides, the keyboard navigation is treated as if it was attached once more (that's my assumption) - meaning that when we did one cycle of navigation (go to another view and back), trigger auto completion and press arrow down on keyboard it jumps two records down instead of one. The problem is incremental so when we do for example 4 cycles of navigation and press arrow down key, we jump 4 items down and the 4th item is highlighted.
var autoCompleteEntry = new RadAutoComplete
{
BindingContext = _viewModel,
Placeholder = $"Szukaj {field.Label}...",
FontSize = 16,
TextColor = NeucaColors.Font_CardFrame,
BackgroundColor = Colors.White,
CompletionMode = AutoCompleteCompletionMode.Contains,
SuggestMode = AutoCompleteSuggestMode.Suggest,
NoResultsMessage = $"Brak wyników dla {field.Label}",
SearchThreshold = 3,
};
autoCompleteEntry.SetBinding(RadAutoComplete.TextProperty, new Binding(
nameof(UIFieldConfig.FilterValue),
source: field,
mode: BindingMode.TwoWay
));
autoCompleteEntry.HighlightItemFunc = (filteredItems, searchText) => null;
autoCompleteEntry.TextChanged += AutoCompleteEntryOnTextChanged(field.FieldName);
autoCompleteEntry.Completed +=
dataGridContext == UIDataGridContext.Account
? AccountOnAutoCompleteEntryCompleted
: ClientOnAutoCompleteEntryCompleted;
autoCompleteEntry.SuggestionItemSelected +=
dataGridContext == UIDataGridContext.Account
? AccountOnAutoCompleteEntryOnSuggestionItemSelected
: ClientOnAutoCompleteEntryOnSuggestionItemSelected;
autoCompleteEntry.SetBinding(WidthRequestProperty, new Binding(
nameof(AccountsClientsViewModel.IsEditMode),
source: _viewModel,
converter: new BoolToObjectConverter { TrueObject = 250, FalseObject = 300 }
));
dataRow.Children.Add(autoCompleteEntry);
Unfortunately i cannot provide more than the control initialization.
