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

Radios are not tabbable inside sl-drawer or sl-dialog #2183

Open
BBovvser opened this issue Sep 24, 2024 · 0 comments
Open

Radios are not tabbable inside sl-drawer or sl-dialog #2183

BBovvser opened this issue Sep 24, 2024 · 0 comments
Labels
bug Things that aren't working right in the library.

Comments

@BBovvser
Copy link

BBovvser commented Sep 24, 2024

Describe the bug

Standard html radio inputs aren't tabbable when inside focus-trapping element like sl-drawer or sl-dialog. Adding tabindex="0" doesn't help either.

To Reproduce

Steps to reproduce the behavior:

  1. Create a drawer or a dialog (i haven't tested other focus-trapping components)
  2. Place some <input> tags inside of various type
  3. Tab through the inputs with the Tab key
  4. Notice that the radios are getting skipped

Demo

I used the Codepen examples in the doc and simply added some random inputs:


<sl-drawer label="Drawer" class="drawer-overview">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br/>
<input type="radio" name="radio1">1<br/>
<input type="checkbox" name="checkbox1">2<br/>
<div>
<sl-radio value="1" name="radio2">Option 1</sl-radio>
<sl-radio value="2" name="radio2">Option 2</sl-radio>
</div>
<div>
<input type="radio" name="radio3">Option 1<br/>
<input type="radio" name="radio3">Option 2<br/>
</div>
<sl-radio-group label="Select an option" name="a" value="1">
<sl-radio value="1">Option 1</sl-radio>
<sl-radio value="2">Option 2</sl-radio>
<sl-radio value="3">Option 3</sl-radio>
</sl-radio-group>
<input type="text" name="text1">
<sl-button slot="footer" variant="primary">Close</sl-button>
</sl-drawer>

### Browser / OS - OS: Windows - Browser: Tried both Firefox 130 and Chrome 129

Additional information

It seems using sl-radio-group and sl-radio makes it work, but sl-radio alone is not enough

@BBovvser BBovvser added the bug Things that aren't working right in the library. label Sep 24, 2024
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