sandpack
sandpack copied to clipboard
fix: accessibility issue in tabs
Issue:
- FileTabs has given the role
tab
, but the tab accessibility pattern is not taken care.
Issues noticed:
- Not highlighting the tab when the file name is focused
- Not highlighting the focus state of the editor
- cross icon or close button not keyboard accessible
Fixed:
-
basic tab accessibility pattern :
- on the tab click to focus on the first tab item initially and on the previously focused tab in case it's accessed earlier
- Managing Focus Within Components Using a Roving tabindex
- highlighting the focus on the tab and editor by default outline of the browser when focused
-
on the focus of the tab, close CTA is visible and is keyboard accessible
Screen recording
Tab pattern implementation https://github.com/user-attachments/assets/6221d6dd-1050-486c-adb6-9e2e6b1420f2
Editor accessibility https://github.com/user-attachments/assets/7049baa6-762d-4015-85b6-21fd20a20f41
What kind of change does this pull request introduce?
- Accessibility fix
Checklist
- [ ] Documentation; N/A
- [x] Storybook (if applicable);
- [ ] Tests;
- [x] Ready to be merged;
This fix partially https://github.com/codesandbox/sandpack/issues/1173