1
0
mirror of synced 2024-11-26 06:46:04 +03:00

Bugfix - only selected options that are not disabled should be used when initializing the dropdown

This commit is contained in:
Pete Campbell 2014-02-17 21:16:26 -05:00
parent 0636e42cbc
commit 2a4e026b49

View File

@ -2214,7 +2214,7 @@ the specific language governing permissions and limitations under the Apache Lic
if (opts.element.get(0).tagName.toLowerCase() === "select") {
// install the selection initializer
opts.initSelection = function (element, callback) {
var selected = element.find("option").filter(function() { return this.selected });
var selected = element.find("option").filter(function() { return this.selected && !this.disabled });
// a single select box always has a value, no need to null check 'selected'
callback(self.optionToData(selected));
};
@ -2488,7 +2488,7 @@ the specific language governing permissions and limitations under the Apache Lic
var data = [];
element.find("option").filter(function() { return this.selected }).each2(function (i, elm) {
element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) {
data.push(self.optionToData(elm));
});
callback(data);