File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ the specific language governing permissions and limitations under the Apache Lic
543543 function checkFormatter ( formatter , formatterName ) {
544544 if ( $ . isFunction ( formatter ) ) return true ;
545545 if ( ! formatter ) return false ;
546- throw new Error ( " formatterName must be a function or a falsy value") ;
546+ throw new Error ( formatterName + " must be a function or a falsy value") ;
547547 }
548548
549549 function evaluate ( val ) {
@@ -2814,7 +2814,9 @@ the specific language governing permissions and limitations under the Apache Lic
28142814 //If all results are chosen render formatNoMAtches
28152815 if ( ! this . opts . createSearchChoice && ! choices . filter ( '.select2-result:not(.select2-selected)' ) . length > 0 ) {
28162816 if ( ! data || data && ! data . more && this . results . find ( ".select2-no-results" ) . length === 0 ) {
2817- this . results . append ( "<li class='select2-no-results'>" + self . opts . formatNoMatches ( self . search . val ( ) ) + "</li>" ) ;
2817+ if ( checkFormatter ( self . opts . formatNoMatches , "formatNoMatches" ) ) {
2818+ this . results . append ( "<li class='select2-no-results'>" + self . opts . formatNoMatches ( self . search . val ( ) ) + "</li>" ) ;
2819+ }
28182820 }
28192821 }
28202822
You can’t perform that action at this time.
0 commit comments