Skip to content

Commit 7c72955

Browse files
committed
improve highlighting in single selects
1 parent 2912900 commit 7c72955

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

select2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,11 @@ the specific language governing permissions and limitations under the Apache Lic
21332133

21342134
// and highlight it
21352135
if (noHighlightUpdate !== false) {
2136-
this.highlight(selected);
2136+
if (initial === true && selected >= 0) {
2137+
this.highlight(selected);
2138+
} else {
2139+
this.highlight(0);
2140+
}
21372141
}
21382142

21392143
// hide the search box if this is the first we got the results and there are enough of them for search

0 commit comments

Comments
 (0)