Skip to content

Commit ae71175

Browse files
committed
Added ability to get the dropdown element
1 parent 75a062f commit ae71175

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

select2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,7 @@ the specific language governing permissions and limitations under the Apache Lic
29532953
opts,
29542954
select2,
29552955
value, multiple,
2956-
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data"],
2956+
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data"],
29572957
valueMethods = ["val", "opened", "isFocused", "container", "data"];
29582958

29592959
this.each(function () {
@@ -2980,7 +2980,9 @@ the specific language governing permissions and limitations under the Apache Lic
29802980
select2 = $(this).data("select2");
29812981
if (select2 === undefined) return;
29822982
if (args[0] === "container") {
2983-
value=select2.container;
2983+
value = select2.container;
2984+
} else if (args[0] === "dropdown") {
2985+
value = select2.dropdown;
29842986
} else {
29852987
value = select2[args[0]].apply(select2, args.slice(1));
29862988
}

0 commit comments

Comments
 (0)