tab drag&drop fix

This commit is contained in:
Jan Prochazka 2023-03-05 15:28:29 +01:00
parent f5d41c89e6
commit ff044ebec8
3 changed files with 13 additions and 2 deletions

View File

@ -50,6 +50,6 @@
tabComponent={mountedTabs[tabid]} tabComponent={mountedTabs[tabid]}
{...openedTabsByTabId[tabid]?.props} {...openedTabsByTabId[tabid]?.props}
{tabid} {tabid}
tabVisible={tabid == (shownTab && shownTab.tabid)} tabVisible={tabid == shownTab?.tabid}
/> />
{/each} {/each}

View File

@ -8,7 +8,13 @@
export let multiTabIndex; export let multiTabIndex;
function findShownTab(tabs: TabDefinition[], multiTabIndex, lockedDbMode, currentDb) { function findShownTab(tabs: TabDefinition[], multiTabIndex, lockedDbMode, currentDb) {
const selectedTab = tabs.find(x => x.selected && x.closedTime == null && (x.multiTabIndex || 0) == multiTabIndex); const selectedTab = tabs.find(
x =>
x.selected &&
x.closedTime == null &&
(x.multiTabIndex || 0) == multiTabIndex &&
shouldShowTab(x, lockedDbMode, currentDb)
);
if (selectedTab) { if (selectedTab) {
return selectedTab; return selectedTab;
} }

View File

@ -447,6 +447,11 @@
return x; return x;
}) })
); );
draggingDbGroup.set(null);
draggingDbGroupTarget.set(null);
draggingTab.set(null);
draggingTabTarget.set(null);
} }
let domTabs; let domTabs;