-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Partial rewrite of the slide tabs component #49103
Conversation
This enables us to put icons there, make the layout tighter and fit to tab list contents. It also improves accessibility by adding keyboard handling and changing the structure according to ARIA Authoring Practices Guide.
@gzdunek I applied your feedback. Also notice that I'm planning on removing the simplified string version of tab spec to keep the code simpler, but I need to remove these from the Enterprise code first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that we now have keyboard navigation and better accessibility 👏
onChange={setActiveIndex} | ||
activeIndex={activeIndex} | ||
/> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export const Medium = () => { | ||
const [activeIndex, setActiveIndex] = useState(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a separate state for each slider? They have a different number of steps, so you can visually simulate an 'index out of range' error :)
story.mov
| { | ||
/** Title displayed on the tab. */ | ||
title: string; | ||
ariaLabel?: never; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should allow ariaLabel
when providing the title. However, I'm not sure how practical or useful this would be in real-world scenarios (probably no one would use it anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gzdunek IMO, ariaLabel
doesn't make any sense when the title is here.
This enables us to put icons there, make the layout tighter and fit to tab list contents. It also improves accessibility by adding keyboard handling, focus state, and changing the structure according to ARIA Authoring Practices Guide.
The small size and icons will be required for implementing the new role editor.