Skip to content
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

feat(material/radio): Avoid nested divs in labels by changing to span instead. #20986

Merged

Conversation

jesscxu
Copy link
Contributor

@jesscxu jesscxu commented Nov 6, 2020

What:
Change <div> to <span>

Why:
<div> elements should not be nested inside <label> elements because <label> only allows phrasing content

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 6, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but the commit message check is failing. Multiple scopes aren't allowed so you'll have to either split it two commits or pick only one of the scopes.

@jelbourn
Copy link
Member

jelbourn commented Nov 9, 2020

Splitting into two commits would be preferable.

Also, do none of these elements need to be explicitly set back to display: block? I'd have suspected that would break something otherwise.

@jesscxu
Copy link
Contributor Author

jesscxu commented Nov 9, 2020

Will split this into two! I also imagine display: block might be needed, running tests now.

@jesscxu jesscxu force-pushed the update-span-to-div-for-nested-labels branch from 4d3beac to a9a83c2 Compare November 9, 2020 17:41
@jesscxu jesscxu changed the title feat(material/radio,material/checkbox): Avoid nested divs in labels by changing to span instead. feat(material/radio): Avoid nested divs in labels by changing to span instead. Nov 9, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the check is still failing. The commit also has to include which package it's in (e.g. material/button-toggle).

@crisbeto crisbeto added the merge: preserve commits When the PR is merged, a rebase and merge should be performed label Nov 9, 2020
@jesscxu
Copy link
Contributor Author

jesscxu commented Nov 9, 2020

I think the lint error is referring to another commit message.

@crisbeto
Copy link
Member

crisbeto commented Nov 9, 2020

Hmm true. In that case you have to rebase from master to get the lint check to pass.

@jesscxu
Copy link
Contributor Author

jesscxu commented Nov 9, 2020

Lint error can potentially be ignored: #20914 (comment)

@jesscxu jesscxu force-pushed the update-span-to-div-for-nested-labels branch from a9a83c2 to 266f819 Compare November 9, 2020 18:52
@mmalerba mmalerba added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker and removed merge: preserve commits When the PR is merged, a rebase and merge should be performed labels Nov 12, 2020
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmalerba mmalerba merged commit 86be28e into angular:master Nov 12, 2020
mmalerba pushed a commit that referenced this pull request Nov 12, 2020
… instead. (#20986)

Co-authored-by: Jessica Xu <jessicacxu@google.com>
(cherry picked from commit 86be28e)
crisbeto added a commit to crisbeto/material2 that referenced this pull request Dec 5, 2020
We made similar adjustments to other components that had `div`
elements inside the control `label` (angular#20990, angular#20986), but we never
fixed it for the slide toggle.
@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 Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants