Skip to content

[Bug]: RadioGroup - Setting its value in code is not reflected to the child Radios if some element is between RadioGroup and Radios #1659

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

Open
norikois opened this issue Apr 16, 2025 · 1 comment
Labels
🆕 status: new The issue is new and will be reviewed when somebody picks it up. status: not-a-bug

Comments

@norikois
Copy link

Which component(s) are affected?

Radio & Radio Group

Description

[Bug]: RadioGroup - Setting its value in code is not reflected to the child Radios if some element is between RadioGroup and Radios

Reproduction

  1. Start the attached reproducible sample.

Expected:
"Orange", "Tomato" and "Flounder" in the "Actual (just put in a table)" table should be checked because they are set to their radio group's value.

Actual:
Orange, Tomato and Flounder are not checked.

C_00242270_WCApp8.zip

Workaround

I have not found a workaround.

Is this a regression?

No or unsure. This never worker, or I haven't tried before.

Affected versions

igniteui-webcomponents 5.1.2

Browser/OS/Node environment

Browser: Chrome (135.0.7049.95)
OS: Windows 11

@norikois norikois added 🆕 status: new The issue is new and will be reviewed when somebody picks it up. bug Something isn't working labels Apr 16, 2025
@rkaraivanov
Copy link
Member

After going over the provided sample I'm willing to mark this as not a bug due
to the scenario in which the radio group is used.

The HTML table element and the supporting cast around it (tbody, tr, etc.) have special behavior about what they accept as DOM children.

Let's take the <tr> element:

Image

As per the image above only <td>/<th> elements are permitted to be slotted inside a <tr>.
Anything else is hoisted out of the whole table. Which is exactly what is happening in the provided sample.

The code:

Image

The actual DOM:

Image

All of the igc-radio-group elements are hoisted out of the table leaving only the radios inside the
<td> elements because they do accept flow content.

Because of this nothing is technically slotted inside the radio group and from its point of view it has nothing to manage in terms of radio components.

If that is reproducible outside of a table context then yes, it has to be fixed.

@rkaraivanov rkaraivanov added status: not-a-bug and removed bug Something isn't working labels Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 status: new The issue is new and will be reviewed when somebody picks it up. status: not-a-bug
Projects
None yet
Development

No branches or pull requests

2 participants