question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Radios with name is insufficient

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.4.1

Environment

Windows 10, Chrome 64, React 16.2

Reproduction link

https://jsfiddle.net/fxg8occt/9/

Steps to reproduce

Follow the jsfiddle in example or use this code

<!DOCTYPE html>
<html>
<body>

<p>In this example, there are two radio-groups in same view.</p>

  <input type="radio" name="num" value="1"> 1<br>
  <input type="radio" name="num" value="2" checked> 2<br>
  <input type="radio" name="str" value="A" checked> A<br>
  <input type="radio" name="str" value="B"> B<br>
  <input type="radio" name="num" value="3"> 3

<p><b>Note:</b> When a user clicks on a radio-button, it becomes checked, and all other radio-buttons with equal name become unchecked.</p>

<!--

Imagine these are table rows and I cannot wrap them in Groups properly.

This is not working

<Radio.Group name='num'><Radio value='1'>1</Radio></Radio.Group>
<Radio.Group name='num'><Radio value='2'>2</Radio></Radio.Group>
<Radio.Group name='str'><Radio value='A'>A</Radio></Radio.Group>
<Radio.Group name='str'><Radio value='B'>B</Radio></Radio.Group>
<Radio.Group name='num'><Radio value='3'>3</Radio></Radio.Group>

This is also not working

<Radio name='num' value='1'>1</Radio>
<Radio name='num' value='2'>2</Radio>
<Radio name='str' value='A'>A</Radio>
<Radio name='str' value='B'>B</Radio>
<Radio name='num' value='3'>3</Radio>

-->

</body>
</html>

What is expected?

Expected is that if I have for example a table and some of the rows belong to group A and others to group B I will get automatic behavior as is specified in HTML Radio Button Specification.

What is actually happening?

In first example: non of the Radios are in a group. In second example: every Radio is in one group.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
afc163commented, Apr 19, 2018

Use Radio.Group to wrap same group Radio. We don’t support name-binding radio now and probably won’t.

0reactions
afc163commented, Apr 19, 2018

You have to maintain a exclusive selected state for all Radios, like table radio selection did: https://github.com/ant-design/ant-design/blob/master/components/table/Table.tsx#L471-L488

Read more comments on GitHub >

github_iconTop Results From Across the Web

In JavaScript, how can I get all radio buttons in the page with a ...
You can use document.getElementsByName() , passing the name of the radio group, then loop over them inspecting the checked attribute, ...
Read more >
Using AP2802I with POE-injector, Fails to bring up radios due ...
Using AP2802I with POE-injector, Fails to bring up radios due to "not enough POE power" ... Hi. We have 3 new 2802I that...
Read more >
Radio Group Example Using Roving tabindex | APG | WAI - W3C
This example implements the features of the Radio Group Design ... the inline SVG radio button graphics in the CSS file have sufficient...
Read more >
AP275 Radio disabled due to low power | Wireless Access
Then says "shutting down Radio due to insufficient power". ... Cisco Catalyst 2960-S Series Switches support IEEE 802.3at (PoE+) devices.
Read more >
Amateur Radio Support | KENWOOD USA
KENWOOD has developed a new site for Amateur Radio Product registration. ... you may make a request to have this done by providing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found