Skip to content

bug(mat-slider): when mat-slider has parent with .mat-accent it will not show the primary color #21271

Closed

Description

@andreElrico

Reproduction

Steps to reproduce:

https://stackblitz.com/edit/angular-ma9v9u?file=src%2Fapp%2Flist-single-selection-example.html

Expected Behavior

mat-slider with color=primary should display primary color, nomatter where its used.

Actual Behavior

If parent has class mat-accent it will make the slider accent color.

Solution

The solution is obvious:

this here wins over mat-primary ... Im asking if other components are programmed in this same "general selector fashion"

Environment

latest stackblitz from docs (see date of this post)

Activity

  1. added
    needs triage
    on Dec 10, 2020
  2. jelbourn commented on Dec 10, 2020

    @jelbourn
    Contributor

    While I agree that this is kind of weird, I don't think we will do anything to change it. It's somewhat unexpected to put a slider inside of another form control that supports the color input. In particular, putting a slider into a selection list or chip would be invalid from an accessibility perspective.

  3. crisbeto commented on Dec 10, 2020

    @crisbeto
    Member

    This can happen if a slider is put inside a tab group with an explicit color. Reopening.

  4. added
    P3
    and removed
    needs triage
    on Dec 10, 2020
  5. andreElrico commented on Dec 10, 2020

    @andreElrico
    Author

    Thank you @crisbeto, I can confirm, it will happen with a tab with color accent. It will also happen with a slider inside a toolbar.
    It seems NOT to happen with vert./hor. stepper.

  6. self-assigned this
    on Dec 12, 2020
  7. added a commit that references this issue on Dec 12, 2020
    93cd5ef
  8. added a commit that references this issue on Dec 21, 2020
    502c4b3
  9. added a commit that references this issue on Apr 25, 2021
    c869e56
  10. added 2 commits that reference this issue on Jan 15, 2022
    b851456
    64dd8ed
  11. angular-automatic-lock-bot commented on Feb 15, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Feb 15, 2022
  13. added a commit that references this issue on Apr 3, 2022
    82861a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: material/slider

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions