Skip to content

Commit 6c59b1e

Browse files
Only select the first suitable item if nothing is already selected
1 parent 291f595 commit 6c59b1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ the specific language governing permissions and limitations under the Apache Lic
21662166
}
21672167
});
21682168

2169-
if (this.opts.closeOnSelect){
2169+
if (this.highlight() == -1){
21702170
choices.each2(function (i, choice) {
21712171
if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
21722172
self.highlight(0);

0 commit comments

Comments
 (0)