Skip to content

Commit 9d06fe2

Browse files
committed
Render formatNoMatches when all ajax results are selected select2#381
1 parent 07afbdf commit 9d06fe2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

select2.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,6 +2592,11 @@ the specific language governing permissions and limitations under the Apache Lic
25922592
self.highlight(0);
25932593
}
25942594

2595+
//If all results are chosen render formatNoMAtches
2596+
if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
2597+
this.results.append("<li class='select2-no-results'>" + self.opts.formatNoMatches(self.search.val()) + "</li>");
2598+
}
2599+
25952600
},
25962601

25972602
// multi

0 commit comments

Comments
 (0)