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

Tabs: add dismissable functionality to tab #12813

Closed
2 tasks
Tracked by #8487
tay1orjones opened this issue Dec 7, 2022 · 5 comments · Fixed by #13529
Closed
2 tasks
Tracked by #8487

Tabs: add dismissable functionality to tab #12813

tay1orjones opened this issue Dec 7, 2022 · 5 comments · Fixed by #13529

Comments

@tay1orjones
Copy link
Member

tay1orjones commented Dec 7, 2022

This issue is for the implementation of dismissible functionality for tabs.

Open questions:

  • There's lots of conversation around dismissible tabs with regards to accessibility:
  • Does the design allow for users to put non-operable icon tabs next to dismissasble tabs in the tablist?
    • A: No, the entire tab group/list must be all the same type
  • Will this actually unmount the tab component, or will it just be a handler?
    • We'll probably want to provide users a callback that they can use to unmount the component
    • This should support consumer's ability to add a confirmation dialog or similar before actually closing/unmounting the tab.
    • This also will need to support the use case of an tab containing unsaved work, to prompt for save, and/or allow devs to save data in the background
  • Does this apply to ContainedTabs? Can they be dismissed?

#12813 (comment)

@francinelucca
Copy link
Collaborator

Does the design allow for users to put non-operable icon tabs next to dismissasble tabs in the tablist?
A: No, the entire tab group/list must be all the same type

@laurenmrice @kingtraceyj What's the expected behavior if this happens? what should be rendered if a user tries to mix dismissable tabs with non-operable tabs?

@francinelucca
Copy link
Collaborator

[ ] Dismissible tabs: add delete/close via keyboard and operable 'x' icons

is the keyboard close interaction performed through focus > space/enter or just the Escape key?
CC @tay1orjones @mbgower

@tay1orjones
Copy link
Member Author

@francinelucca The WAI-ARIA Tabs pattern states Delete should be used, not Escape.

All children elements of tab are presentational in nature and I believe should not receive focus, so this would additionally rule out the focus > space/enter.

@tay1orjones
Copy link
Member Author

What's the expected behavior if this happens? what should be rendered if a user tries to mix dismissable tabs with non-operable tabs?

I'd vote for dismissable to "win" and the icons on all other tabs are not rendered. With how composable the API is though we won't always be able to restrict this I think. It might be something we could warn about in dev mode though through conditional props or something?

@tay1orjones
Copy link
Member Author

tay1orjones commented Apr 18, 2023

@francinelucca for clarity though, the spec does allow for tabs to be dismissable and have a descriptive icon #8487 (comment), it's just that all tabs must be dismissable or not I think

Adding this functionality is slated for a separate issue #12845

@francinelucca francinelucca moved this from 🏗 In Progress to 🚦 In Review in Design System Apr 20, 2023
@kodiakhq kodiakhq bot closed this as completed in #13529 May 18, 2023
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants