Autocomplete: Clearing selection using SelectedValueChanged #4587
-
I have a shared List<string> of selected values that is populated by Autocomplete in default selection mode and another source as well. I'm achieving this by using the event callback SelectedValueChanged instead of @bind-SelectedValue. My goal now is to clear the input field after a value is selected from the dropdown and passed into the OnSelectionChanged handler. On the documentation I noticed there is a Clear method but I'm not sure how to use it. Should I create a reference to the Autocomplete component and call it on the list manipulation method? How do I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @Hugo-Matias
Something along those lines, you might have to fix syntax. |
Beta Was this translation helpful? Give feedback.
Hello @Hugo-Matias
Yes, that is how you call methods on the component, add
@ref="myAutocompleteRef"
to the component.and
Something along those lines, you might have to fix syntax.