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

<select> without multiple might have multiple selected options #6

Open
savvan0h opened this issue Nov 12, 2019 · 0 comments
Open

<select> without multiple might have multiple selected options #6

savvan0h opened this issue Nov 12, 2019 · 0 comments

Comments

@savvan0h
Copy link

selected can be set to multiple select options even if the select is not multiple if you choose an option more than once.
I think clickedOption.attr('selected', 'selected'); below should be replaced with select.val(clickedOption.val()); so only one option has selected .

      if(multiselect){
       ...
      }else{
        buttonsHtml.find('a, span').removeClass('picked');
        $(this).addClass('picked');
        clickedOption.attr('selected', 'selected'); // should be select.val(clickedOption.val());
      }
@savvan0h savvan0h changed the title <select> without multiple might have multiple selected options <select> without multiple might have multiple selected options Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant