Open adiun opened 2 years ago
you are right, there is no easy way to get the new activeTab among its sibling tabs. currently you will need to search in the previous layout structure, to find its parent panel, then find that panel in the new layout and get its active tab.
I probably wont add this in the api directly, mainly because when you drag one tab to another panel, the old panel would also switch to a new tab. To me that's same as a tab being closed.
after all the new active tab doesn't get the focus, so if there are multiple panels, you can't say any of the panels has the activeTab of the whole layout.
Getting the
currentTabId
inonLayoutChange
is useful, but if a tab is closing,currentTabId
corresponds to the tab being closed.It doesn't seem like there's an easy way to get the "tab becoming active after close".
For example, I have logic that works in some cases that goes like this:
This works except when there is a panel with only one tab - for example if you have two panels docked SxS, each with one tab. If I close one panel, then that entire panel is going away and step 2.2 above will fail. So then I have to look at the box/panel containing that panel, and so on...
I think ideally
onLayoutChange
should return the actualactiveTabId
.