@reltio/components 1.4.1807 → 1.4.1808

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.
@@ -23,6 +23,20 @@ var DndManager = /** @class */ (function () {
23
23
  if (!needsRedraw) {
24
24
  return;
25
25
  }
26
+ var treeIndex = dropTargetProps.treeIndex, swapFrom = dropTargetProps.swapFrom;
27
+ if (component) {
28
+ var boundingRect = (0, react_dom_1.findDOMNode)(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node
29
+ var ownMiddleY = (boundingRect.bottom - boundingRect.top) / 2;
30
+ var clientOffset = monitor.getClientOffset();
31
+ // Moving down: exit if we're in upper half
32
+ if (swapFrom <= treeIndex && clientOffset.y < boundingRect.top + ownMiddleY) {
33
+ return;
34
+ }
35
+ // Moving up: exit if we're in lower half
36
+ if (swapFrom >= treeIndex && clientOffset.y > boundingRect.top + ownMiddleY) {
37
+ return;
38
+ }
39
+ }
26
40
  _this.lastDropTargetNode = dropTargetProps.node;
27
41
  _this.lastDropTargetDepth = targetDepth;
28
42
  _this.dragHover({
@@ -21,6 +21,20 @@ var DndManager = /** @class */ (function () {
21
21
  if (!needsRedraw) {
22
22
  return;
23
23
  }
24
+ var treeIndex = dropTargetProps.treeIndex, swapFrom = dropTargetProps.swapFrom;
25
+ if (component) {
26
+ var boundingRect = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node
27
+ var ownMiddleY = (boundingRect.bottom - boundingRect.top) / 2;
28
+ var clientOffset = monitor.getClientOffset();
29
+ // Moving down: exit if we're in upper half
30
+ if (swapFrom <= treeIndex && clientOffset.y < boundingRect.top + ownMiddleY) {
31
+ return;
32
+ }
33
+ // Moving up: exit if we're in lower half
34
+ if (swapFrom >= treeIndex && clientOffset.y > boundingRect.top + ownMiddleY) {
35
+ return;
36
+ }
37
+ }
24
38
  _this.lastDropTargetNode = dropTargetProps.node;
25
39
  _this.lastDropTargetDepth = targetDepth;
26
40
  _this.dragHover({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1807",
3
+ "version": "1.4.1808",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",