feat: multi tab scrolling optimization
This commit is contained in:
@@ -80,6 +80,7 @@ export default function EditFlowName({ displayName, isActive }: Props) {
|
||||
whiteSpace="nowrap"
|
||||
overflow="hidden"
|
||||
textOverflow="ellipsis"
|
||||
userSelect="none"
|
||||
>
|
||||
{displayName}
|
||||
</Text>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user