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 Multiple won't deselect #2554

Closed
anthropos9 opened this issue Dec 28, 2015 · 10 comments
Closed

Select Multiple won't deselect #2554

anthropos9 opened this issue Dec 28, 2015 · 10 comments

Comments

@anthropos9
Copy link

I have several select items that are using the multiple option. On render they correctly show which items have been selected. If I select a new item it gets added to the list correctly. My issue is that if i deselect an item that was selected at render and submit, that deselection doesn't get saved. In firebug I can see that there's no change in the selected property on the actual select item. Not sure If I'm doing it wrong or if there is an error in the code. Here's the code for one of my selects:

<div class="input-field col s12 l6">
    <select name="groups[1][]" id="frm_groups_1" multiple>
        <option value="" disabled >Choose groups</option>
        <option value="39" >Cancer Research Protocols</option>
        <option value="38" >Document Editor</option>
        <option value="37" >Jobs Admin</option>
        <option value="36" selected>Per Diem Agency</option>
        <option value="35" >EPFM</option>
        <option value="34" >TFM</option>
        <option value="33" >Blog Author</option>
        <option value="32" >Provider Editor</option>
        <option value="31" >Marketing Coordinator</option>
        <option value="30" >CareConnect</option>
        <option value="29" >Foundation Events Manager</option>
        <option value="28" >Medical Staff</option>
        <option value="27" >Class Admin</option>
        <option value="26" >Page Editor</option>
        <option value="25" selected>Administrators</option>
        <option value="9" selected>Super Administrators</option>
    </select>
</div>

And from the jQuery file I have:

    $('select').material_select();
@anthropos9
Copy link
Author

FYI I am using 0.97.5

@Tim-arts
Copy link
Contributor

Hi, this issue should be fixed with a bunch of others in the next release if they accept the PR : #2514

For now you can take the component code directly on my repository.

Note : You can add a label to your select for name it.

@nicolasFauren
Copy link

Hi,

We have the same issue with deselecting an option. I'll try @TyrionGraphiste code.

@nicolasFauren
Copy link

@TyrionGraphiste 's code seems to work fine for the multiple select so far. Thank you

@Tim-arts
Copy link
Contributor

Tim-arts commented Jan 3, 2016

@nicolasFauren Thanks for replied
@acburst Do you want to merge the PR ?

@lebart
Copy link

lebart commented Jan 12, 2016

Hi,

Same issue here.
Any updates about the merge of the PR or any other solution?

@Tim-arts
Copy link
Contributor

Hi, I'm currently working on an other version. If you want to test it before a probable PR please refer to #2522 (comment)

@lebart
Copy link

lebart commented Jan 12, 2016

@TyrionGraphiste Thank you

@Tim-arts
Copy link
Contributor

I added the CSS in my last post, you can add after materialize.css for taking account all changes.

@fega
Copy link

fega commented May 7, 2017

Closed due inactivity, feel free to reopen it if it is still necessary.

@fega fega closed this as completed May 7, 2017
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

5 participants