File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 22 * Gravity Perks // Advanced Select // Clear Button
33 * https://gravitywiz.com/documentation/gravity-forms-advanced-select/
44 *
5- * Adds a Clearn button to selection options in Dropdown fields. By default,
6- * the remove button is only added to Multi-Select fields.
5+ * Adds a Clear buton to GP Advanced Select fields.
76 *
87 * The Clear Button is a built in plugin of Tom Select.
98 * @reference https://tom-select.js.org/plugins/clear-button/
1615window . gform . addFilter (
1716 'gpadvs_settings' ,
1817 function ( settings , gpadvsInstance , selectNamespace ) {
19- settings . plugins . clear_button = {
20- title : 'Clear options' ,
21- } ;
18+ /**
19+ * Scope to only dropdown fields.
20+ * This can also be changed to 'multiselect' to only target multi-select fields
21+ * OR the conditional can be removed to apply to all fields.
22+ */
23+ if ( gpadvsInstance . fieldType === 'dropdown' ) {
24+ settings . plugins . clear_button = {
25+ title : 'Clear options' ,
26+ } ;
27+ }
2228
2329 return settings ;
2430 }
You can’t perform that action at this time.
0 commit comments