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

Tab: Select the first item if activeTabIndex is out of bounds #193

Open
edizcelik opened this issue Apr 6, 2022 · 0 comments
Open

Tab: Select the first item if activeTabIndex is out of bounds #193

edizcelik opened this issue Apr 6, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@edizcelik
Copy link
Contributor

edizcelik commented Apr 6, 2022

After a Tab component is rendered on the screen, we can modify the items prop and pass in a new array. For example, we might display one tab on larger screens while two tabs on the smaller screens. If the second item was selected as active and then the screen size is changed so that the items array has only one element in it, activeTabIndex becomes out of bounds and we don't display anything as the tab body. In this case, I think we can simply fallback and set the activeTabIndex as 0. Example use case of this is available on Tinyman on the staking program detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants