vanillaSelectBox icon indicating copy to clipboard operation
vanillaSelectBox copied to clipboard

Group option isn't checked if all child options are checked initially

Open Stiggi opened this issue 2 years ago • 1 comments

Hi,

I have several grouped options. It works fine, if I select them manually.

If the child options are checked initally, then the group option isn't checked.

See this fiddle: https://jsfiddle.net/stiggi/8co2buya/

Best regards Michael

Stiggi avatar Dec 02 '22 10:12 Stiggi

workaround it with the following

let parentElements = this.drop.querySelectorAll("li.grouped-option");
if(parentElements){
    Array.prototype.slice.call(parentElements).forEach(function (x) {
        self.checkUncheckFromChild(x.nextSibling);              
    });
}

before line 1288

self.title.textContent = selectedTexts;
self.privateSendChange();

Stiggi avatar Dec 02 '22 12:12 Stiggi