question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs: is there a way to opt out of triggering tab switching for elements within the TabList?

See original GitHub issue

CodeSandbox: 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aaronmcadamcommented, Dec 16, 2019

@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.

1reaction
segunadebayocommented, Oct 10, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found