Skip to content

Commit

Permalink
Merge pull request #1478 from jumpserver/pr@dev@fix_drag_session
Browse files Browse the repository at this point in the history
fixed: Fixed the issue of dragging tab talkback
  • Loading branch information
ZhaoJiSen authored Sep 11, 2024
2 parents 22a4e35 + 8b72ce8 commit e42787d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ui/src/components/Kubernetes/MainContent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ const initializeDraggable = () => {
// @ts-ignore
useDraggable<UseDraggableReturn>(tabsContainer, panels.value, {
animation: 150,
onStart: () => console.log('Drag started'),
onEnd: async event => {
const newIndex = event.newIndex;
const oldIndex = event.oldIndex;
Expand Down Expand Up @@ -328,17 +327,18 @@ const initializeDraggable = () => {
updatedPanels.splice(oldIndex, 1);
updatedPanels.splice(newIndex, 0, movedPanel);
// await nextTick();
await nextTick(() => {
panels.value = updatedPanels;
panels.value = updatedPanels;
// 更新当前激活的标签
const newActiveTab: string = panels.value[newIndex]?.name as string;
// 更新当前激活的标签
const newActiveTab: string = panels.value[newIndex]?.name as string;
if (newActiveTab) {
nameRef.value = newActiveTab;
terminalStore.setTerminalConfig('currentTab', newActiveTab);
}
if (newActiveTab) {
nameRef.value = newActiveTab;
findNodeById(newActiveTab);
terminalStore.setTerminalConfig('currentTab', newActiveTab);
}
});
}
}
});
Expand Down

0 comments on commit e42787d

Please sign in to comment.