Skip to content

fix(material/radio): clear names from host nodes - #15422

Closed
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:radio-host-node-names
Closed

fix(material/radio): clear names from host nodes#15422
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:radio-host-node-names

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Along the same lines as #15368. Clears the name from the host node of the radio button and radio group, because they end up being forwarded to the underlying input and can cause double results when using something like getElementsByName.

@crisbetocrisbeto added the target: patch This PR is targeted for the next patch release label Mar 8, 2019
@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 8, 2019
jelbourn
jelbourn previously approved these changes Mar 9, 2019

@jelbournjelbourn 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

@jelbournjelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Mar 9, 2019
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 16, 2019
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide toggle's host node in order to prevent both the underlying input and the host from showing up in `document.getElementsByName` or `By.name`.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 23, 2019
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide toggle's host node in order to prevent both the underlying input and the host from showing up in `document.getElementsByName` or `By.name`.
@mmalerbammalerba added aaa and removed aaa labels Apr 25, 2019
crisbeto added a commit to crisbeto/material2 that referenced this pull request May 4, 2019
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide toggle's host node in order to prevent both the underlying input and the host from showing up in `document.getElementsByName` or `By.name`.
@crisbeto
crisbetoforce-pushed the radio-host-node-names branch from 225cbc8 to a6b2616CompareJuly 1, 2019 20:16
crisbeto added a commit to crisbeto/material2 that referenced this pull request Jul 21, 2019
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide toggle's host node in order to prevent both the underlying input and the host from showing up in `document.getElementsByName` or `By.name`.
@crisbeto
crisbetoforce-pushed the radio-host-node-names branch from a6b2616 to 5c2c31bCompareOctober 1, 2019 19:32
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 29, 2019
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide toggle's host node in order to prevent both the underlying input and the host from showing up in `document.getElementsByName` or `By.name`.
@crisbeto
crisbetoforce-pushed the radio-host-node-names branch from 5c2c31b to d298469CompareMay 2, 2020 15:08
@crisbetocrisbeto added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jun 7, 2020
@crisbeto
crisbetoforce-pushed the radio-host-node-names branch from d298469 to f7e96d2CompareJune 7, 2020 09:12
@mmalerbammalerba removed the lgtm label Jul 31, 2020
crisbeto added a commit to crisbeto/material2 that referenced this pull request Jan 10, 2021
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide
toggle's host node in order to prevent both the underlying input and the host from showing
up in `document.getElementsByName` or `By.name`.
@devversion
devversion removed their request for review August 18, 2021 12:54
@andrewseguinandrewseguin added needs rebase and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Dec 29, 2021
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 7, 2022
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide
toggle's host node in order to prevent both the underlying input and the host from showing
up in `document.getElementsByName` or `By.name`.
@crisbetocrisbeto changed the title fix(radio): clear names from host nodesfix(material/radio): clear names from host nodesMar 7, 2022
@crisbeto
crisbetoforce-pushed the radio-host-node-names branch from f7e96d2 to bbbc038CompareMarch 7, 2022 08:45
crisbeto added a commit that referenced this pull request Mar 9, 2022
Along the same lines as #15422 and #15368. Clears the static `name` attribute from the slide
toggle's host node in order to prevent both the underlying input and the host from showing
up in `document.getElementsByName` or `By.name`.
(cherry picked from commit 5db1df0)
crisbeto added a commit that referenced this pull request Mar 9, 2022
Along the same lines as #15422 and #15368. Clears the static `name` attribute from the slide
toggle's host node in order to prevent both the underlying input and the host from showing
up in `document.getElementsByName` or `By.name`.
@andrewseguinandrewseguin removed the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Mar 28, 2022
forsti0506 pushed a commit to forsti0506/components that referenced this pull request Apr 3, 2022
Along the same lines as angular#15422 and angular#15368. Clears the static `name` attribute from the slide
toggle's host node in order to prevent both the underlying input and the host from showing
up in `document.getElementsByName` or `By.name`.
@amysortoamysorto self-assigned this May 11, 2022
@amysorto

Copy link
Copy Markdown
Contributor

Shoud the name be assigned to the inner input? In a test within google3, the input within the radio had this name "mat-radio-group-0" instead of what was being passed in.

@andrewseguin

Copy link
Copy Markdown
Contributor

@crisbeto Heads up that Amy has a quick question about going forward on this change

@crisbeto

crisbeto commented Aug 15, 2022

Copy link
Copy Markdown
MemberAuthor

I think that we talked through this over DM at some point. The fix is correct, but it ended up breaking internally because apps were projecting all sorts of unrelated content into the radio buttons.

@andrewseguin

Copy link
Copy Markdown
Contributor

Gotcha thanks - @amysorto Do you have a good idea on how to get those tests passing with this change? Feel free to pair with myself or Kristiyan to get this in

Along the same lines as angular#15368. Clears the `name` from the host node of the radio button and radio group, because they end up being forwarded to the underlying `input` and can cause double results when using something like `getElementsByName`.
@crisbeto

Copy link
Copy Markdown
MemberAuthor

Looks like this is really breaking internally. I'll close it for now since we haven't gotten any issue reports about it.

@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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Mar 30, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakertarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@crisbeto@amysorto@andrewseguin@jelbourn@devversion@googlebot@mmalerba