-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Issue with deselectAll and radio multiselect (multiple = false) #473
Comments
If the problem is the browser behaviour, may be it could at least select the first radio option by default when we deselectAll ? |
I had to do a refresh: $('#myMS').multiselect('refresh'); |
+1 To fix this, I've swapped out the 'change' events for 'click' events. Is there a reason why the 'change' event is used instead of the 'click' event? |
Not sure whether the |
@zephyx did your provided solution ever got into the source code and released as I am facing the same issue in 2020 while using the plugin. I used various combinations of .val(''), .multiselect('resfresh'), .multiselect('deselectAll', false), and .multiselect('updateButtonText') as suggested in docs and many issues and although a specific combination resolves the issue at the browser side of clearing the selected radio button however when the values is submitted back to the server, it has the last "default / selected" option as selected. What are the recommendations? |
Same issue here. $('.myselect').val('');
$('.myselect').multiselect('refresh'); |
Hi,
When I try to clearSelection my multiselect the label of the multiselect is properly reset but when I open my multiselect the previous radio button chosen is still checked.
If I am not wrong I think it probably comes from the deselectAll function where only the checkbox case is handled.
I have added a:
var type = this.options.multiple === true ? "checkbox" : "radio";
And I use this variable inside the js selectors (ie: $("li input[type='"+type+"']:enabled" ) and it seems to work. It's important for me because I trigger something on the change event :). If a value is already selected we can't fire the change event except if we select an other option and come back later.
The text was updated successfully, but these errors were encountered: