File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ angular.module('$strap.directives')
3939 // Bootstrap override
4040 var typeahead = element . data ( 'typeahead' ) ;
4141 // Fixes #2043: allows minLength of zero to enable show all for typeahead
42- typeahead . lookup = function ( ev ) {
42+ typeahead . lookup = function ( ev ) {
4343 var items ;
4444 this . query = this . $element . val ( ) || '' ;
4545 if ( this . query . length < this . options . minLength ) {
@@ -49,9 +49,10 @@ angular.module('$strap.directives')
4949 return items ? this . process ( items ) : this ;
5050 } ;
5151
52- if ( attrs . matchall === "true" ) {
53- // return true on every server side sugg
54- typeahead . matcher = function ( item ) {
52+ var matchAll = element . data ( 'data-match-all' ) ;
53+ if ( typeof ( matchAll ) != 'undefined' && matchAll === "true" ) {
54+ // Return true on every item, for example if the dropdown is populated with server-side sugggestions
55+ typeahead . matcher = function ( item ) {
5556 return true ;
5657 } ;
5758 }
You can’t perform that action at this time.
0 commit comments