mirror of
https://github.com/docmost/docmost.git
synced 2026-05-18 15:34:05 +08:00
fix(base): absolutely position row-number content to eliminate layout shift
This commit is contained in:
@@ -298,27 +298,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.rowNumberCellInner {
|
.rowNumberCellInner {
|
||||||
display: flex;
|
position: relative;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 4px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.rowNumberIndex {
|
.rowNumberIndex,
|
||||||
display: inline;
|
.rowNumberCheckbox {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rowNumberCheckbox {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rowNumberCheckbox,
|
|
||||||
.rowNumberDragHandle {
|
.rowNumberDragHandle {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 4px;
|
||||||
|
transform: translateY(-50%);
|
||||||
display: none;
|
display: none;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
|
||||||
|
|
||||||
.rowNumberDragHandle {
|
|
||||||
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
}
|
}
|
||||||
@@ -327,7 +334,7 @@
|
|||||||
cursor: grabbing;
|
cursor: grabbing;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On hover, hide the index and show drag handle + checkbox */
|
/* On row hover: swap index for checkbox, reveal drag handle */
|
||||||
.row:hover .rowNumberIndex {
|
.row:hover .rowNumberIndex {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -336,9 +343,8 @@
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When selected, checkbox always visible; index + drag handle hidden */
|
/* Selected row: checkbox always visible, drag handle still only on hover */
|
||||||
.rowSelected .rowNumberIndex,
|
.rowSelected .rowNumberIndex {
|
||||||
.rowSelected .rowNumberDragHandle {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.rowSelected .rowNumberCheckbox {
|
.rowSelected .rowNumberCheckbox {
|
||||||
|
|||||||
Reference in New Issue
Block a user