Skip to content

Optiongroup children should be indented #1474

@mrleblanc101

Description

@mrleblanc101

Currently, it's difficult to understand the relation between optiongroup children and their parent as the is no indentation.
The parent has a light grey background, but it's that it's a parent-children relationship.

Capture d’écran, le 2021-08-16 à 15 01 38

I think the optiongroup children should be indented just like in regular select.
Capture d’écran, le 2021-08-16 à 14 47 58

I could do this with custom style, but optiongroup children are not nested inside their parent in the HTML and the children have no specific class, only the optiongroup parent has a class.

If I add padding to all element, then remove the padding for the optiongroup parent, this will affect my other multiselect that do not have optiongroup. There is no global class on the component to know if it has optiongroup or not.

.multiselect__option {
    padding-left: 24px; // Add padding to every element
}
.multiselect__option--group {
    padding-left: 12px; // Remove padding to every parent
}

What it should be:

.multiselect__option--children {
    padding-left: 24px; // Add padding only to children
}

or

.multiselect.has-option-group {
    .multiselect__option {
    padding-left: 24px; // Add padding to every element
    }
    .multiselect__option--group {
    padding-left: 12px; // Remove padding to every parent
    }
}

Capture d’écran, le 2021-08-16 à 14 58 39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions