AlaskaAirlines / auro-radio

Custom input element of type radio generally used in radio groups—collections of radio buttons describing a set of related options
https://auro.alaskaair.com/components/auro/radio
Apache License 2.0
1 stars 5 forks source link

auro-radio-group: option selected feature #97

Closed jesussilverioea closed 4 months ago

jesussilverioea commented 1 year ago

Is your feature request related to a problem? Please describe.

Similarly to auro-select or auro-menu, the ability to have the option selected from the auro-radio-group would be very useful. This can be use to make decisions after the user has selected one of the options form the radio-group.

Describe the solution you'd like

The option to have a property for a selected option on the radio-group.

For instance:

image

In the case of the image, the option "No" would be the option selected.

e.g this is an example of how it is in the auro-select component

image

fajar-apri-alaska commented 7 months ago

Isn't it better to have selected or checked property instead in the auro-radio element, since radio component can only have one selected items in it ?

A radio group is a set of checkable buttons, known as radio buttons, where no more than one of the buttons can be checked at a time. (https://www.w3.org/WAI/ARIA/apg/patterns/radio/)

But its fine if we want to make it the same as auro-select implementation.

blackfalcon commented 7 months ago

@fajar-apri-alaska if I understand what you are asking, the issue there is the shadowDOM. Each radio button is inside an element and wrapped in the shadowDOM. At the time we built this, using the standard radio button features did not create a grouping that fit the model you referenced from the W3C.

That's why we built the radio-group and had to redevelop all the standard HTML interaction features. There is some new forms support work we want to get on the books and we can re-review how this works there.