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

SlRadioGroup / SlRadio has weird click behavior when using validation and empty values #2229

Open
schilchSICKAG opened this issue Oct 25, 2024 · 0 comments
Labels
bug Things that aren't working right in the library.

Comments

@schilchSICKAG
Copy link
Contributor

Describe the bug

When using an <sl-radio-group> with required set to true, it is not possible to select <sl-radio> elements that do not have a value property set when clicking on the item the first time.

To Reproduce

Steps to reproduce the behavior:

  1. Open the codepen https://codepen.io/schilchSICKAG/pen/JjgOxyv?editors=1000. It extends the shoelace documentation for <sl-ragio-group> with a custom <sl-radio> that has no value set.
  2. Select a valid option (all options except the second one) and submit. Everything should be fine.
  3. Try to click the second radio. You will see it does nothing.
  4. Try to click the second radio again. It will now select the value and will be invalid.

Browser / OS

  • OS: [e.g. Mac, Windows] All
  • Browser: [e.g. Chrome, Firefox, Safari] All
  • Browser version: [e.g. 22] All

Additional information

We ran into this while writing a generic custom validation wrapper component (what a word!) for our shoelace based design system (which by the way, may also be of interest for you?) and initially thought this would be an implementation problem on our side.

Although I have not looked into this issue for now, would be happy to provide a PR for this if requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

1 participant