Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Support Controlled Tabs #81

Open
sam-chuang opened this issue Oct 23, 2020 · 2 comments
Open

Support Controlled Tabs #81

sam-chuang opened this issue Oct 23, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sam-chuang
Copy link

Is your feature request related to a problem? Please describe.
I need to know which tab is active, so I can do something(fetch data for instance) when tab is in active state

Describe the solution you'd like
If tabs support the controlled state, I guess I can use the selectedId to know which tab is active

Describe alternatives you've considered

  1. provide context store that I can get selectedId and use it to know which tab is active
  2. provide a hook that returns whether tabId is active or not
@jxom
Copy link
Owner

jxom commented Oct 27, 2020

Hey, sorry about the late reply. Ideally, it would be nice to create a pattern like Tabs.State or Tabs.useState just like we do for our Modals so you can choose to control the state. I'll need to add this in. I think it would also be nice to add a prop to defer mounting of a tab panel until the tab is clicked too, which may be a nicer solution to fetch data for a particular tab.

@jxom jxom added the enhancement New feature or request label Oct 27, 2020
@sam-chuang
Copy link
Author

Thanks!! those will be very helpful features!!

@jxom jxom added the good first issue Good for newcomers label Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants