Skip to content

Accessibility: list in nested options #5915

@meldafert

Description

@meldafert

Hello,

When using nested options (<optgroup>), a <ul> item gets added to contain the options.
However, this does conform to WCAG, as the group inside of a listbox only may contain elements with an option role.

var $childrenContainer = $('<ul></ul>', {
'class': 'select2-results__options select2-results__options--nested'
});

This can be fixed by giving the <ul> a role='none', as then it is ignored.
I would be open to writing a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions