support optgroup, collapse optgroups