Fixed the optgroup collapsing and selecting when using the filter