Tabs: is there a way to opt out of triggering tab switching for elements within the TabList?
See original GitHub issueCodeSandbox: https://codesandbox.io/s/chakra-js-starter-w4vym
In my UI, I need an edit button that edits the tabs themselves.
When clicking on this button, my behaviour triggers, but it also tries to switch the tab to an empty state (because there isn’t a 3rd tab, I’m guessing). Even with controlled state, the tab still switches. So in my onClick
handler, I’m setting the tabIndex
to the current one that I’m tracking in local state.
I appreciate this use case might be a little bit advanced, but I didn’t want to resort to rendering the edit button outside of TabList
and then absolutely positioning it so that it looks like it is within the tab list element.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Show or hide object tabs
Select tabs to move between tables, forms, reports, queries in single-document view. ... Right click the tab to save the object or switch...
Read more >Building accessible user interface tabs in JavaScript
Here's everything you need to know to create an accessible tabbed user interface: HTML structure, CSS styling, and JavaScript enhancements.
Read more >ARIA: tab role - Accessibility - MDN Web Docs - Mozilla
Focuses and optionally activates the next tab in the tab list. If the current tab is the last tab in the tab list...
Read more >Tabbed Interfaces
This is all possible by giving each tab but the selected tab tabindex="-1" , which removes the inactive tabs from focus order but...
Read more >Tabs
The tab list, which should have role="tablist"; The tabs in that list, ... The slds-dropdown__list element requires a slds-dropdown_length-with-icon-10 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@segunadebayo no, I just didn’t have a need to implement this anymore in my project. We went with another UI to edit different lists of stuff that get displayed as tabs. Thanks for following up.
I’m not sure I understand this use case very well. Perhaps, you could add the modal that edits the task so I can get the full context. Then list out the expected behavior