question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mat-radio-button and mat-checkbox don't line wrap

See original GitHub issue

Bug, feature request, or proposal:

Proposal: change <mat-radio-button> or <mat-checkbox> to line-wrap its contents by default or add an option.

What is the expected behavior?

I can put a text into a <mat-radio-button> or <mat-checkbox> that is longer than what fits into the viewport.

What is the current behavior?

The content in a <mat-radio-button> or <mat-checkbox> does not line wrap. If you have a lot of text in a <mat-checkbox> it gets cut at the end.

A workaround would be <mat-radio-button><span style="white-space: normal;">{{mylongtext}}</span></mat-radio-button>

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-uaeetd?file=app/app.component.html

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

I have a pretty narrow window and need to put checkboxes and radio buttons in there.

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

I think all of them.

Is there anything else we should know?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:18
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

20reactions
sergioebccommented, Mar 13, 2019

=== styles.css ===

.mat-checkbox-layout { white-space: normal !important; }

.mat-radio-label { white-space: normal !important; }

18reactions
davidmorissettecommented, Aug 23, 2018

Redefine that style:

.mat-radio-label {
   white-space: normal;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I toggle between mat-checkbox or mat-radio-button ...
There are several problems. First, calling multipleAnswer only inside ngOnInit sets this boolean variable only once at begining, it should be inside ...
Read more >
Radio button | Angular Material
The radio-button label is provided as the content to the <mat-radio-button> element. The label can be positioned before or after the radio-button by...
Read more >
Configurable checkbox - StackBlitz
<mat-checkbox class="example-margin" [. (ngModel)]="checked">Checked</. mat-checkbox> ... <mat-radio-group [(ngModel)]="align">. <mat-radio-button.
Read more >
Easy Angular Testing – UI Elements – Select, Radio Button ...
<<mat-checkbox> provides the same functionality as a native ... Like we do in the select above, we grab our mat-radio-button data from a ......
Read more >
@abt-desk/realogy-mat-theme - npm
Use a color of primary to ensure it stands out from content. If you would like the floating action button to contain children,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found