-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support standalone radio buttons #7840
Comments
This could be implemented by adding logic similar to
This could be implemented by changing this line to query assigned nodes instead of web-components/packages/radio-group/src/vaadin-radio-group-mixin.js Lines 91 to 93 in 4991d83
|
Two wild ideas:
|
Probably not. There are no attributes that would change on the |
I was thinking of weird effects like an internal |
I suppose there could be some weird (bad UX?) scenarios where selection of one (or more) of the radio buttons would then enable a sub-selection of a nested radio button group:
but in that situation, the unchecking of the radio buttons in the nested radio button group should be distinct from those of the outer radio button group. |
Any recursive finding of all children would have to stop searching if encountering another This actually makes me think of another way of implementing this. |
Describe your motivation
There are cases where a more complex UI design requires that individual radio buttons are not siblings in the DOM. A simple case is if each of them needs to be wrapped in an additional
<div>
for styling purposes.The problem is that a
<vaadin-radio-button>
remains rendered as checked when another one from the same group gets selected. If I manually give each one the samename
, then the internal<input>
elements get unchecked but there's nothing that removes thechecked
attribute from the parent component which means that it's still visually checked.Describe the solution you'd like
One alternative would be to provide the same flexibility as with
<input type="radio">
so that you could put radio buttons anywhere in the DOM as long as they use the samename
value.An alternative would be if
<vaadin-radio-group>
could detect<vaadin-radio-button>
(or<input type="radio">
?) elements that are descendants even if they are not direct children of the group. The benefit of this is that you don't need to manually define aname
.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: