svelte-material-ui
svelte-material-ui copied to clipboard
Button for clearing value of Autocomplete
Is your feature request related to a problem? Please describe. I'm implementing autocomplete fields in my forms and some things could possibly improve the UX. The first thing I would suggest adding to the autocomplete or even to all text input field is an option to include a simple button that clears the field.
Another thing, if a value is selected in the Autocomplete component, clicking it again could select the text in the field automatically so the user doesn't need to double click or select the whole text manually. This could also be solved with a clear value button as stated above.
Describe the solution you'd like Adding a "clear field" button next to the field.
Describe alternatives you've considered
I've implemented this my adding an IconButton next to the Autocomplete field with on:click={() => value = undefined}
.
Additional context
A gif of what I implemented for reference
How the MudBlazor library does it for use with Blazor https://mudblazor.com/components/autocomplete#presentation