Skip to content

MatButtonToggle doesn't support width's change #8432

Closed
@BobBDE

Description

@BobBDE

Bug, feature request, or proposal:

Bug
I've noticed that the components MatButtonToggle and MatButtonToggleGroup don't support a different width than the default one. When we change the width of a button toogle the clickable zone of the button stay the same size and the text is not align in the center.

What is the expected behavior?

Be able to change the width of the MatButtonToggle and MatButtonToggleGroup and have the text centered.

What is the current behavior?

The clickable zone width is not changed when the width of the button toggle is changed.
The text is not center aligned.

What are the steps to reproduce?

Here is the plunker : http://plnkr.co/edit/oM6mG7vwQoisbJzx8GoL?p=preview
I added some CSS to highlight the problem of clickable zone. The red zone of the button is the clickable zone while the button is bigger than this.

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

I think the problem is in all the material version

Is there anything else we should know?

We can still correct this with some global CSS by changing the size of the div (child of button toggle) with the class : .mat-button-toggle-label-content
And the text alignment can be easily corrected by adding a 'text-align : center' to the button toggle element.

Thank you guys for your work, please continue like this !! :)

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions