aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-21 21:32:03 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-21 21:32:03 -0400
commit0f3e2be5cf429da12f694121597e94bc56b3e354 (patch)
tree9fdcf84a2e92a54970733e23a24cfc3329b82426 /src
parent14ce80e04b921adccccca29e6947c22f9ede4800 (diff)
dropped rows update index properly so dragging them without re-selecting works
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 570b614d8..7fcac09dc 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -151,7 +151,7 @@ export class CollectionSchemaView extends CollectionSubView() {
return widths;
}
- @computed get heights() {
+ @computed get rowHeights() {
const heights = this.childDocs.map(() => (this.rowHeightFunc()))
return heights;
}
@@ -430,7 +430,7 @@ export class CollectionSchemaView extends CollectionSubView() {
findRowDropIndex = (mouseY: number) => {
let index: number = 0;
- this.heights.reduce((total, curr, i) => {
+ this.rowHeights.reduce((total, curr, i) => {
if (total <= mouseY && total + curr >= mouseY) {
if (mouseY <= total + curr) index = i;
else index = i + 1;
@@ -517,7 +517,6 @@ export class CollectionSchemaView extends CollectionSubView() {
this._selectedCol = col;
if (this._lowestSelectedIndex === -1 || index < this._lowestSelectedIndex) this._lowestSelectedIndex = index;
- console.log(this._lowestSelectedIndex)
//let selectedIndexes: Array<Number> = this._selectedCells.map(doc => this.rowIndex(doc));
};
@@ -569,6 +568,7 @@ export class CollectionSchemaView extends CollectionSubView() {
draggedDocs.forEach(doc => {
DocumentManager.Instance.AddViewRenderedCb(doc, dv => dv.select(true));
});
+ this._lowestSelectedIndex = Math.min(...draggedDocs?.map(doc => this.rowIndex(doc)));
return true;
}
return false;