Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Autocomplete setMenuItems immediately unset after close/reopen #551

Open
3 tasks done
gselderslaghs opened this issue Dec 14, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@gselderslaghs
Copy link
Member

Before submitting...

Context

setMenuItems method sets and shows the new created entries but unsets them directly when focus on the input element for autocomplete search or after close/reopen the options

Current Behavior

Calling the setMenuItems method shows the list of the defined entries within the methods argument, but does not seem to set them as permanent entries, when you trigger keyboard interaction or close/reopen the option entries, items set by setMenuItems are not visible but shows the initial data entries
Changing the minLength to a number greater then 0, seem to affect the open functionality

Expected behavior

When changing the entries with the setMenuItems method, they should remain visible after component interaction
The method should be the main method for handling create/update/delete items dynamically
Updated entries should be:

  • accessible even when dropdown element is closed/opened
  • accessible by autocomplete search
  • accessible when minLength value is greater then 0

Possible Solutions or Causes

menuItems property is empty after focusing into the input field or emptying the field after selection, probably the element is re-initialized where options data entries overwrite the given argument

Steps to reproduce

Codepen example

Your Environment

  • Version used: 2.1.1
@gselderslaghs gselderslaghs added the bug Something isn't working label Dec 14, 2024
gselderslaghs added a commit to gselderslaghs/materialize that referenced this issue Jan 4, 2025
…nt to set new or reset selected values, implement open argument to conditionally open dropdown on menu items change materializecss#551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant