sl-drawer issues when using keyboard navigation #2018
Labels
bug
Things that aren't working right in the library.
fixed-in-wa
This issue has been fixed or isn't relevant to Web Awesome.
Describe the bug
When using keyboard navigation in
<sl-drawer>
, you will get one extra tabbable element becausedrawer__panel
has a tabindex set to0
.To Reproduce
Steps to reproduce the behavior:
Open this codepen. Navigate the pen via keyboard. Do not click the Danger Button. During navigation, you will have a highlight of:
document.activeElement
points tosl-drawer
)The issue here is the applied
tabindex="0"
for thedrawer__panel
element.Suggested fix: Remove the tabindex value. Demo:
As above, but click the danger button before tabbing. Expected highlight is now:
Demo
Codepen available at https://codepen.io/schilchSICKAG/pen/OJYygjK?editors=1001
Screenshots
If applicable, add screenshots to help explain the bug.
Browser / OS
Additional information
I do not know why the
tabindex="0"
is set on the element at all. Thedrawer__overlay
already has an index of-1
, so this should not be an issue? Would be happy to provide a PR for this :)The text was updated successfully, but these errors were encountered: