Repository navigation
Closed
Labels
P4A relatively minor issue that is not relevant to core functionsarea: material/radiofeatureLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fix
Description
Bug, feature request, or proposal:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
What is the expected behavior?
We need some built-in means to add labels (probably, not only for md-radio-group) when needed.
What is the current behavior?
There is no built-in way to give a label to a md-radio-group. You have to add, lay out and style HTML label, span or div by yourself.
What are the steps to reproduce?
Using a sample layout:
<label>Sort by</label>
<md-radio-group>
<md-radio-button value="1">Date</md-radio-button>
<md-radio-button value="2">Status</md-radio-button>
<md-radio-button value="3">From</md-radio-button>
<md-radio-button value="4">To</md-radio-button>
</md-radio-group>
What is the use-case or motivation for changing an existing behavior?
Many times we want to label a md-radio-group, but don't have built-in means to do so.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/material": "2.0.0-beta.11"
Reacted by Michał Stawicki, Ross Lavery, Denis Shadrin, Quentin, Georgekutty Antony, Alessio Stalla, Ryan Naddy, Andrew and rrajewski
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsarea: material/radiofeatureLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fix
Activity
leocaseiro commentedon Nov 14, 2017
Perhaps if we implement #7891, it'll work for
radio-groupas well.leocaseiro commentedon Nov 14, 2017
A quick solution for that, is using a
mat-listand the[mat-subheader], like so:Eq: https://plnkr.co/edit/k73FSy?p=preview
PS: You might need some style for your
mat-radio-groupandmat-radio-button.[-]Lablel for md-radio-group[/-][+]Label for md-radio-group[/+]marcusportmann commentedon Jul 28, 2018
I had the same problem and created a simple component that leverages the functionality provided by the MatFormField component.
You can use it like this:
radio-group-form-field.ts.txt
mindscratch commentedon Apr 28, 2021
@marcusportmann anyone use the
radio-group-form-fieldin angular 11? I'm trying to resolve the incompatibilities myself. I've gotten close(?)...currently getting:donroyco commentedon Apr 28, 2021
Please do not use this issue for problems or bugs. File a new bug via the issue template or use Stack Overflow to get an answer to your problem.
mindscratch commentedon Apr 29, 2021
check out a newer version: https://github.com/marcusportmann/inception/tree/master/src/inception-angular/projects/ngx-inception/src/lib/core/components
jelbourn commentedon Aug 26, 2021
Closing this since I don't see us adding support for this feature. It's not something that's really visually captured in the material design spec explicitly. Not implementing something here means that you can add the style of label that best suits your app.
angular-automatic-lock-bot commentedon Sep 26, 2021
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 commentedon Sep 27, 2021
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.