-
-
Notifications
You must be signed in to change notification settings - Fork 106
Description
Before submitting...
- I have searched for duplicate or closed issues.
- I have read the CONTRIBUTING document and my issue is following the guidelines.
- I have read the template completely before filling it in.
Context
I would like to be able to use the Autocomplete component but allow the user to select a different option after initially selecting an item.
Current Behavior
When you select an item using the autocomplete, it doesn't let you change your selection. You can try deleting the text shown or typing in something different, but your changes are undone.
Expected behavior
I would expect that a user isn't forced to use their first selection and should be free to search for and select other options.
Possible Solutions or Causes
I think it's because the autocomplete.options.data value gets overwritten when menu items are selected:
materialize/src/autocomplete.ts
Line 536 in 5ba03a9
this.options.data = menuItems; |
Steps to reproduce
This behavior is demonstrated even with the example Autocomplete control in the docs:
https://materializeweb.com/autocomplete.html
Click in the autocomplete box, select an option, and then try selecting a different option.
Your Environment
- Version used: 2.2.2
- Browser Name and version: Firefox 138.0.3
- Operating System and version (desktop or mobile): Windows 11
- Additional information you want to tell us: