andreww1011 / filter-multi-select

Multiple select dropdown with filter jQuery plugin.
Other
29 stars 15 forks source link

Is it possible to remove or disable the "Select All" function or catch this event? #23

Closed smartlegionlab closed 1 year ago

smartlegionlab commented 1 year ago

Is it possible to remove or disable "Select All"?

Is it possible to somehow handle this event?

The matter is that there is a form, at a choice, variants in the second field are dynamically loaded. If you click "Select All", then the optionselected event will fire as many times as the options were selected, thereby triggering the same number of requests to the API.

I have two options:

  1. Remove "Select All"
  2. Catch this event.
andreww1011 commented 1 year ago

You can hack it with CSS to remove the select all checkbox.

Although not documented, the select all checkboxes are consistently identified by "--1-chbx". You can take advantage of this with the following CSS:

.items > .dropdown-item:has(label[for$="--1-chbx"]) { display: none; }

Being undocumented, this may change in future releases.

smartlegionlab commented 1 year ago

It really worked. Thank you very much. I wish prosperity to you and your projects!