The Wayback Machine - https://web.archive.org/web/20200526063646/https://github.com/Dogfalo/materialize/issues/6536
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

getSelectedValues only return previous clicked values #6536

Open
weasteam opened this issue Mar 25, 2020 · 1 comment
Open

getSelectedValues only return previous clicked values #6536

weasteam opened this issue Mar 25, 2020 · 1 comment

Comments

@weasteam
Copy link

@weasteam weasteam commented Mar 25, 2020

Expected Behavior

https://materializecss.com/select.html
Say we have 3 options as described in the above link. Here are my actions and return value

# Click Option clicked Expected value return from instance.getSelectedValues() return from e.target.value
1 Option 1 Option 1 `` Option 1
2 Option 2 Option 2 Option 1 Option 2
3 Option 3 Option 3 Option 2 Option 3
4 Option 1 Option 1 Option 3 Option 1

When instance.getSelectedValues() is called, it always return previous clicked values.

It should return the current clicked value

Current Behavior

See the return from column 4

Steps to Reproduce (for bugs)

Add the below code to the select onChange

        console.log(instance.getSelectedValues());
        console.log(e.target.value);

Context

Your Environment

  • Version used: v1.0.0
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): Mac desktop
@weasteam
Copy link
Author

@weasteam weasteam commented Mar 25, 2020

if multiple is provided, getSelectedValues () works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.