Kaynağa Gözat

Merge pull request #1336 from igaidai4uk/patch-1

Remove duplication of "No matches found" message
Igor Vaynberg 12 yıl önce
ebeveyn
işleme
78e686c23b
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      select2.js

+ 3 - 1
select2.js

@@ -2739,7 +2739,9 @@ the specific language governing permissions and limitations under the Apache Lic
 
             //If all results are chosen render formatNoMAtches
             if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
-                this.results.append("<li class='select2-no-results'>" + self.opts.formatNoMatches(self.search.val()) + "</li>");
+            	if(!data || data && !data.more) {
+            	    this.results.append("<li class='select2-no-results'>" + self.opts.formatNoMatches(self.search.val()) + "</li>");
+            	}
             }
 
         },