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 setValues results in different outcomes #552

Open
3 tasks done
gselderslaghs opened this issue Dec 14, 2024 · 0 comments
Open
3 tasks done

[Bug]: Autocomplete setValues results in different outcomes #552

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

Comments

@gselderslaghs
Copy link
Member

Before submitting...

Context

Different results in the outcome on method calls of the setValues method in various scenarios

Current Behavior

Scenario 1 - Call setValues with initial data set
When the setValues method is called with an item list containing the id's of the initial data, the component selects the given entries in the item list
Data entry names remain as initialized

Scenario 2 - Call setValues without initial data
In this scenario no data is set on initialization, we call the setValues method with a list of entries, the entries are created as defined in the setValues method, passed entries are rendered in the list and selected

Scenario 3 - Call setValues with initial data and addition of non existing items
Compare the addition of items to scenario 2, where items are being added by setValues
If we call setValues with initial data set, no new items are added but initial items set on the data property are selected, setValues data entry names remain as initialized, even when changed

Expected behavior

As of the JSDocs, the function should set selected values, this seem to work, but since full objects are given and text change does not seem to be permitted on the initially created data entries, it seems a bit redundant passing the full objects

Possible Solutions or Causes

Steps to reproduce

Codepen example with above 3 scenarios demostrated

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 6, 2025
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