Skip to content
This repository

formatSearching can be disabled #434

Merged
merged 1 commit into from almost 2 years ago

2 participants

Jacob Haslehurst Igor Vaynberg
Jacob Haslehurst

formatSearching can be disabled by returning null from the function which allows the searching message to be disabled.

We need this for our use case as we want a first option in the dropdown of 'search everything' available like so

Otherwise the dropdown will flicker to 'Searching...' as each character is pressed.

It can be used in the select2 options like so:

formatSearching: ->
    return

or javascript

formatSearching: function() {},
Jacob Haslehurst hzy formatSearching can be disabled
formatSearching can be disabled by returning null from the function which allows the searching message to be disabled.
3fcfbed
Igor Vaynberg ivaynberg merged commit e28ea42 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 21, 2012
Jacob Haslehurst hzy formatSearching can be disabled
formatSearching can be disabled by returning null from the function which allows the searching message to be disabled.
3fcfbed
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  select2.js
2  select2.js
@@ -1226,7 +1226,7 @@
1226 1226 }
1227 1227 return;
1228 1228 }
1229   - else {
  1229 + else if (opts.formatSearching() != null) {
1230 1230 render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
1231 1231 }
1232 1232

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.