'Leaflet Leaflet.StyledLayerControl issue on selectLayer

I'm fairly new in working with Leaflet and I have an Styled Layer Control with exclusive group select, following the steps from Leaflet.StyledLayerControl. To it, I've added also a custom option (inside a group with checkboxes) that selects some of the layers from the group.

control.selectLayer(corn_sp);

It selects the correct layers from the group, but it collapses the current group and expands the first one when it runs the line this._update() from the styledLayerControl.js Is there a way to keep the group opened? Or to "know" what group is opened, and force it to open again?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source