aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-23 17:36:55 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-04-23 17:36:55 -0400
commitd25beeb937bd6fa82cbf08e8289be6fbf22aec19 (patch)
treec86467400eb608e9f3ab3c17cef9fc65035ceff0 /src
parenta114de8e42c20edc7dabce6e2ac94559279d9aa0 (diff)
jitter on initial drag fixed (computed value caching)
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 46048a408..1e8dbc937 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -418,6 +418,8 @@ export class CollectionSchemaView extends CollectionSubView() {
*/
@action
setRelCursorIndex = (mouseY: number) => {
+ this._mouseCoordinates.y = mouseY;
+
let rowHeight = CollectionSchemaView._rowHeight;
let adjInitMouseY = mouseY - rowHeight - 100; //rowHeight: height of the column menu cells | 100: height of the top menu
let yOffset = this._lowestSelectedIndex * rowHeight;
@@ -449,8 +451,8 @@ export class CollectionSchemaView extends CollectionSubView() {
//fix index if selected rows are dragged out of bounds
let adjIndex = index - this._relCursorIndex;
let maxY = this.rowHeights.reduce((total, curr) => total + curr, 0) + rowHeight;
- if (mouseY > maxY) index = this.childDocs.length - 1;
- else if (adjIndex <= 0) return 0
+ if (mouseY > maxY) adjIndex = this.childDocs.length - 1;
+ else if (adjIndex <= 0) adjIndex = 0;
return adjIndex;
};
@@ -552,8 +554,8 @@ export class CollectionSchemaView extends CollectionSubView() {
@computed
get rowDropIndex(){
- const mouseY = this.ScreenToLocalBoxXf().transformPoint(this._mouseCoordinates.x, this._mouseCoordinates.y)[1];
- const index = this.findRowDropIndex(mouseY);
+ let mouseY = this.ScreenToLocalBoxXf().transformPoint(this._mouseCoordinates.x, this._mouseCoordinates.y)[1];
+ let index = this.findRowDropIndex(mouseY);
return index
}