mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-12 16:00:33 +00:00
fix(file): stabilize closable tab width to avoid layout jitter (#14013)
The closable card tabs animated the close icon width between active and inactive tabs, so each tab switch reflowed the tab bar and caused the page to jitter. Reserve the close icon slot and toggle it with opacity instead, matching the terminal tab implementation.
This commit is contained in:
@@ -2851,6 +2851,36 @@ onBeforeUnmount(() => {
|
||||
border-bottom: 1px solid var(--el-border-color-light) !important;
|
||||
}
|
||||
|
||||
/* Keep the closable tab width stable so switching tabs does not reflow the tab bar */
|
||||
:deep(.file-tabs .el-tabs__header .el-tabs__item.is-closable) {
|
||||
padding: 0 20px;
|
||||
|
||||
.is-icon-close {
|
||||
width: 14px;
|
||||
margin-left: 5px;
|
||||
right: 0;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity var(--el-transition-duration);
|
||||
}
|
||||
|
||||
&.is-active,
|
||||
&:hover,
|
||||
&:focus-within {
|
||||
.is-icon-close {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (hover: none), (pointer: coarse) {
|
||||
.is-icon-close {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.file-tabs .el-tabs--card > .el-tabs__header .el-tabs__item.is-active) {
|
||||
border-bottom-width: 1px !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user