We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 76765ce + 3bd7ca0 commit b8f43deCopy full SHA for b8f43de
app/assets/javascripts/active_admin/searchable_select/init.js
@@ -6,6 +6,14 @@
6
// reading from data allows <input data-searchable_select='{"tags": ['some']}'>
7
// to be passed to select2
8
var options = $.extend(extra || {}, item.data('searchableSelect'));
9
+
10
+ // default option allow clear (must have placeholder and allowClear to options)
11
+ if (options.placeholder == undefined)
12
+ options.placeholder = '';
13
14
+ if (options.allowClear == undefined)
15
+ options.allowClear = true;
16
17
var url = item.data('ajaxUrl');
18
19
if (url) {
@@ -43,4 +51,4 @@
43
51
$(function() {
44
52
initSearchableSelects($(".searchable-select-input"));
45
53
});
46
-}());
54
+}());
0 commit comments