dojox/form/CheckedMultiSelect can not be cleared programatically probably due to a bug in dijit/form/_FormSelectWidgetMixin
- Dominant language
- HTML
- Stars
- 172
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
Description:
I have a CheckedMultiSelect widget configured to allow multiple values, if I call:
mywidget.set("value", ["value1", "value2"]);
Selects the two values as expected.
If I call:
mywidget.set("value", []);
Expected behaviour:
No value should be selected in the widgets and all the checkboxes should appear unchecked.
Actual behaviour:
The already selected checkboxes remain checked. Interestingly though, if you click in a different checkbox than the already selected one you will notice that the others are unchecked.
Doing mywidget.set("value", "") doesn't solve the problem either.
How to reproduce:
See this Fiddle: http://jsfiddle.net/41Lh0zoj/
More info:
I think that the problem is exactly here: https://github.com/dojo/dijit/blob/041948280c2b9ba102c52c35f02d80901fce6b93/form/_FormSelectWidget.js#L462
I don't think that checking 'typeof val[0] == "undefined"' is right, because like in this case, val might be an empty array and that seems perfectly fine to me. Doing this additional checks avoids calling _setDiaplsy and _updateSelection which is causing the reported problem.
Contributor guide
Assessment
This issue has not been assessed yet.