You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Device: [e.g. Desktop, Laptop, iPhone6, etc.]
OS: [e.g. iOS]
Browser: [e.g. chrome, safari]
Version: [e.g. 22]
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:
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: