Skip to content

Commit 9cb1847

Browse files
committed
Merge pull request select2#2055 from mac2000/feature-request-search-input-placeholder
Optional Search Input Placeholder parameter added
2 parents e559f92 + 89ae701 commit 9cb1847

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

select2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ the specific language governing permissions and limitations under the Apache Lic
800800
opts.element.prop("autofocus", false);
801801
if (this.autofocus) this.focus();
802802

803+
this.search.attr("placeholder", opts.searchInputPlaceholder);
803804
},
804805

805806
// abstract
@@ -2274,7 +2275,7 @@ the specific language governing permissions and limitations under the Apache Lic
22742275
if (noHighlightUpdate !== false) {
22752276
if (initial === true && selected >= 0) {
22762277
// By default, the selected item is displayed inside the result list from a single select
2277-
// User can provide an implementation for 'hideSelectionFromResult' and hide it
2278+
// User can provide an implementation for 'hideSelectionFromResult' and hide it
22782279
if(this.opts.hideSelectionFromResult !== undefined && selectedElm !== null) {
22792280
if(this.opts.hideSelectionFromResult(selectedElm))
22802281
selectedElm.addClass("select2-selected");
@@ -3328,7 +3329,8 @@ the specific language governing permissions and limitations under the Apache Lic
33283329
adaptContainerCssClass: function(c) { return c; },
33293330
adaptDropdownCssClass: function(c) { return null; },
33303331
nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
3331-
hideSelectionFromResult: function(selectedObject) { return undefined; }
3332+
hideSelectionFromResult: function(selectedObject) { return undefined; },
3333+
searchInputPlaceholder: ''
33323334
};
33333335

33343336
$.fn.select2.ajaxDefaults = {

0 commit comments

Comments
 (0)