aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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
}