feat: multi tab scrolling optimization

This commit is contained in:
Aller05
2024-04-18 05:25:04 +00:00
parent 316f5c1def
commit 8dc3aa557c
2 changed files with 9 additions and 5 deletions
+1
View File
@@ -80,6 +80,7 @@ export default function EditFlowName({ displayName, isActive }: Props) {
whiteSpace="nowrap"
overflow="hidden"
textOverflow="ellipsis"
userSelect="none"
>
{displayName}
</Text>
+8 -5
View File
@@ -89,11 +89,14 @@ export default function MultipleTabs() {
});
setIsDirty(detail.activeTab.isDirty);
curVersion && setCurVersion(null);
document
.getElementById(
`workspace-multiple-tabs-item-${detail.activeTab.id}`,
)
?.scrollIntoView({ behavior: "smooth" });
// Avoid scrolling when the corresponding element has not yet been rendered.
setTimeout(() => {
document
.getElementById(
`workspace-multiple-tabs-item-${detail.activeTab.id}`,
)
?.scrollIntoView({ behavior: "smooth" });
}, 0);
break;
}
};