Skip to content

[Radio group] Required form validation #2637

@rvanderveen058

Description

@rvanderveen058

Provide a general summary of the issue here

When required, an initial value is not seen at validation.

🤔 Expected Behavior?

form.reportValidity() to return true.

😯 Current Behavior

Image

By the way: selecting another option after validation, a red border is shown at previous option.
Image

💁 Possible Solution

No response

🖥️ Steps to Reproduce

<sl-form-field label=${msg('Number of decimals')}>
  <sl-radio-group name="nrOfDecimals" required @sl-change=${this.#nrOfDecimalsChange} value="1">
    <sl-radio value="0">0</sl-radio>
    <sl-radio value="1">1</sl-radio>
    <sl-radio value="2">2</sl-radio>
  </sl-radio-group>
</sl-form-field>

What browsers are you seeing the problem on? (only for bugs in code)

Safari

If other, please specify.

No response

What operating system are you using?

MacOS

👤 Your name

Ronald van der Veen

🧢 Your product/team

Magister

🎨 Your Theme(s)

Magister

Metadata

Metadata

Assignees

Type

Projects

Status

✈️ Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions