-
Notifications
You must be signed in to change notification settings - Fork 25
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
Tabset is not resetting back, when first tab is removed. #872
Labels
Comments
Hi @jav7zaid, thank you for submitting an issue and your feedback! The You do bring up a good point here, and we'll consider it. |
hi @jav7zaid, thank you for offering to push a PR to fix. Please do. 👍 |
9 tasks
i have raised PR, have a look. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
So, i was digging into Tabset for my project related work and observed that when you are on the first tab and try to remove it, the next available correct tab/panel doesn't gets selected.
So why is this happening?
As per my understanding, the observed attribute that triggers the onAttributeChange callback is the 'current-tab' property, and as we are on the first tab and trying to remove the same, there is no change in the old and new value, thats why the update doesn't happen.
Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior
Should select the next available tab, similar to what is happening when you try to remove the last tab.
Screenshots
Environment
Please complete the following information:
Additional Context
I can raise a PR as well, let me know.
How to fix this - docs/components/tabset/tabset-demo.js
Line no - 31 - check for currentTab value, when the updation occurs, seems to solve this issue.
// keep correct tab/panel pair open when a "tab" is added or when first tab is removed
if (this.autoUpdate || this.currentTab === 0) {
this.update();
}
This fix is just a workaround for demo and not a proper solution, but I am thinking of a proper use case here.
I know we could use update() function wherever we want to sync, but can this be handled as part of Tabset component ?
The text was updated successfully, but these errors were encountered: