Skip to content
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

CdsRadio and CdsRadioGroup status issue #302

Open
3 of 8 tasks
squidjam opened this issue Apr 12, 2024 · 0 comments
Open
3 of 8 tasks

CdsRadio and CdsRadioGroup status issue #302

squidjam opened this issue Apr 12, 2024 · 0 comments

Comments

@squidjam
Copy link

squidjam commented Apr 12, 2024

Describe the bug

Declaring a status of 'error' or 'success' on a CdsRadioGroup does not apply it correctly to itself nor to it's chldren CdsRadio components

How to reproduce

Create a page to implement CDS (core and react) and implement the following code:

<CdsRadioGroup layout="vertical-inline" status="error">
				<label>error</label>
				<CdsRadio>
					<label>radio 1</label>
					<input type="radio" value="1" checked={true} />
				</CdsRadio>
				<CdsRadio>
					<label>radio 2</label>
					<input type="radio" value="2" />
				</CdsRadio>
				<CdsRadio>
					<label>radio 3</label>
					<input type="radio" value="3" />
				</CdsRadio>
				<CdsControlMessage>error message</CdsControlMessage>
			</CdsRadioGroup>

Opening the developer console, one can see it's being rendered as neutral:

<cds-radio-group role="group" cds-control-group="" status="neutral" layout="vertical-inline" control-align="left" control-width="stretch" aria-labelledby="_fli69q9ea" aria-describedby="_zbpwz73hd">
  <label slot="label" id="_fli69q9ea">error</label>
  <cds-radio cds-control="" status="neutral" control-width="stretch" control-align="left" layout="vertical" slot="controls" _checked="">
    <label slot="label" for="_3yn9ov2ju">radio 1</label>
    <input type="radio" value="1" checked="" name="_hb4anhl3t" slot="input" id="_3yn9ov2ju">
  </cds-radio>
  <cds-radio cds-control="" status="neutral" control-width="stretch" control-align="left" layout="vertical" slot="controls">
    <label slot="label" for="_tiotltu5n">radio 2</label>
    <input type="radio" value="2" name="_hb4anhl3t" slot="input" id="_tiotltu5n">
  </cds-radio>
  <cds-radio cds-control="" status="neutral" control-width="stretch" control-align="left" layout="vertical" slot="controls">
    <label slot="label" for="_yiu14oyjs">radio 3</label>
    <input type="radio" value="3" name="_hb4anhl3t" slot="input" id="_yiu14oyjs">
  </cds-radio>
  <cds-control-message slot="message" status="neutral" id="_zbpwz73hd">error message</cds-control-message>
</cds-radio-group>

Expected behavior

The status written on the parent CdsRadioGroup component should be applied to itself and its CdsRadio children.

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

Clarity version:

  • v5.x
  • v6.x

Framework:

  • Angular
  • React
  • Vue
  • Other:

Framework version:
Windows

Device:

  • Type: Laptop
  • OS: Windows
  • Browser Chrome
  • Version latest

Additional notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant