Skip to content

Show the selected option when md-button-toggle is disabled #3007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jefersonestevo opened this issue Feb 9, 2017 · 1 comment · Fixed by #3012
Closed

Show the selected option when md-button-toggle is disabled #3007

jefersonestevo opened this issue Feb 9, 2017 · 1 comment · Fixed by #3012
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix

Comments

@jefersonestevo
Copy link
Contributor

Bug, feature request, or proposal:

feature request

What is the expected behavior?

Change the style from the disabled "md-button-toggle" when it's checked. This way we can show a disabled group and still let the user know which option was selected before

What is the current behavior?

When disabled, the framework applies the class "mat-button-toggle-disabled" that changes the background of the button to: $md-grey, 200.

What are the steps to reproduce?

Just disable a md-button-toggle-group with one of the options selected. You can't see which one was selected.

Providing a Plunker (or similar) is the best way to get the team to see your issue.

What is the use-case or motivation for changing an existing behavior?

I have a page when the user select an option on a md-button-toggle-group and, on the next page, I need to show the selected option but do not let the user change it.

Which versions of Angular, Material, OS, browsers are affected?

@angular/material: 2.0.0-beta.1

Is there anything else we should know?

The simples solution will be to add a different background-color when the button is disabled and checked (not tested):
File: _button-toggle-theme.scss
.mat-button-toggle-disabled {
background-color: map_get($mat-grey, 200);
color: mat-color($foreground, disabled-button);

&.mat-button-toggle-checked {
background-color: map_get($mat-grey, 400);
}
}

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix
Projects
None yet
3 participants