Skip to content

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

Merged
mmalerba merged 1 commit into
angular:masterfrom
jesscxu:update-span-to-div-for-nested-labels
Nov 12, 2020
Merged

mmalerba merged 1 commit into
angular:masterfrom
jesscxu:update-span-to-div-for-nested-labels

Conversation

@jesscxu

@jesscxu jesscxu commented Nov 6, 2020 •

Copy link
Copy Markdown
Contributor

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

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

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

jelbourn commented Nov 9, 2020

Copy link
Copy Markdown
Contributor

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

jesscxu commented Nov 9, 2020

Copy link
Copy Markdown
Contributor Author

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

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

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

jesscxu commented Nov 9, 2020

Copy link
Copy Markdown
Contributor Author

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

@crisbeto

crisbeto commented Nov 9, 2020

Copy link
Copy Markdown
Member

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

@jesscxu

jesscxu commented Nov 9, 2020

Copy link
Copy Markdown
Contributor Author

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

@mmalerba mmalerba left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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