Skip to content

bug(slide-toggle): DOM order does not match visual order when slide toggle has labelPosition="before" #26880

Open
@zarend

Description

@zarend

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

DOM order does not match visual order when slide toggle has labelPosition="before"

Reproduction


        <mat-slide-toggle
          labelPosition="before"
        >Activate</mat-slide-toggle>
        
       ```

### Expected Behavior

DOM order matches visual order

### Actual Behavior

label comes after the button in the DOM. I don't have the WCAG criteria handy, but this can cause a11y issues.

### Environment

- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/slide-toggle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions