@mozaic-ds/angular 2.0.58 → 2.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10360,14 +10360,22 @@ class ColumnDragEngine {
|
|
|
10360
10360
|
if (!sourceCell)
|
|
10361
10361
|
return;
|
|
10362
10362
|
const rect = sourceCell.getBoundingClientRect();
|
|
10363
|
-
|
|
10363
|
+
// Read the canonical width from state instead of the rect: when the
|
|
10364
|
+
// source cell happens to be the last rendered cell with `isLast=true`
|
|
10365
|
+
// (flex: 1 0 auto, no fixed width), the rect reflects flex stretching
|
|
10366
|
+
// and the ghost would span the entire scrollable width.
|
|
10367
|
+
const sourceCol = this.state.unpinnedColumns()[this.originalIndex];
|
|
10368
|
+
const width = sourceCol?.currentWidth ?? rect.width;
|
|
10369
|
+
// Clamp the click offset to the ghost's actual width so the cursor stays
|
|
10370
|
+
// over the ghost when the source was rendered wider than `currentWidth`.
|
|
10371
|
+
this.ghostOffsetX = Math.min(this.startX - rect.left, width);
|
|
10364
10372
|
this.ghostOffsetY = this.startY - rect.top;
|
|
10365
10373
|
const ghost = sourceCell.cloneNode(true);
|
|
10366
10374
|
ghost.style.cssText = `
|
|
10367
10375
|
position: fixed;
|
|
10368
10376
|
top: ${rect.top}px;
|
|
10369
10377
|
left: ${rect.left}px;
|
|
10370
|
-
width: ${
|
|
10378
|
+
width: ${width}px;
|
|
10371
10379
|
height: ${rect.height}px;
|
|
10372
10380
|
opacity: 0.92;
|
|
10373
10381
|
z-index: 10000;
|
|
@@ -10546,7 +10554,11 @@ class ColumnDragEngine {
|
|
|
10546
10554
|
findScrollElement() {
|
|
10547
10555
|
if (!this.headerRow)
|
|
10548
10556
|
return null;
|
|
10549
|
-
|
|
10557
|
+
// The actual scroll viewport is `.moz-grid__scroll` — the outer
|
|
10558
|
+
// `.moz-grid` is non-scrollable layout chrome. Reading scrollLeft on
|
|
10559
|
+
// the wrong element would always return 0 and feed a stale value into
|
|
10560
|
+
// the virtualization recompute on mouseup.
|
|
10561
|
+
return this.headerRow.closest('.moz-grid__scroll') ?? null;
|
|
10550
10562
|
}
|
|
10551
10563
|
updateAutoScroll(clientX) {
|
|
10552
10564
|
if (!this.scrollEl) {
|