@rpg-engine/long-bow 0.7.63 → 0.7.65

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.
@@ -27820,6 +27820,7 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27820
27820
  }
27821
27821
  });
27822
27822
  });
27823
+ setDraggingItem(null);
27823
27824
  }, [setTooltipState]);
27824
27825
  var handleSuccessfulDrag = useCallback(function (quantity) {
27825
27826
  resetDragState();
@@ -27837,22 +27838,21 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27837
27838
  var _dragState$position = dragState.position,
27838
27839
  x = _dragState$position.x,
27839
27840
  y = _dragState$position.y;
27840
- if (Math.abs(data.x - x) > 5 || Math.abs(data.y - y) > 5) {
27841
+ if (Math.abs(data.x - x) > 20 || Math.abs(data.y - y) > 20) {
27841
27842
  setDragState(function (prev) {
27842
27843
  return _extends({}, prev, {
27843
27844
  wasDragged: true,
27844
27845
  isFocused: true
27845
27846
  });
27846
27847
  });
27848
+ } else {
27849
+ resetDragState();
27847
27850
  }
27848
27851
  if (!draggingItem) {
27849
27852
  setDraggingItem(item);
27850
27853
  }
27851
27854
  }, [dragState.position, draggingItem, item, setDraggingItem]);
27852
27855
  var onDraggableStop = useCallback(function (e, data) {
27853
- setTimeout(function () {
27854
- setDraggingItem(null);
27855
- }, 50);
27856
27856
  var target = e.target;
27857
27857
  if (!target) return;
27858
27858
  target.classList.remove('react-draggable-dragging');
@@ -27895,13 +27895,14 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27895
27895
  }, 50);
27896
27896
  } else if (item) {
27897
27897
  var isTouch = e.type === 'touchend';
27898
- if (!isContextMenuDisabled && isTouch && !isSelectingShortcut && !draggingItem) {
27898
+ console.log("Debug: \n isTouch: " + isTouch + ",\n isSelectingShortcut: " + isSelectingShortcut + ",\n draggingItem: " + draggingItem + ",\n dragState.wasDragged: " + dragState.wasDragged + ",\n dragState.isFocused: " + dragState.isFocused + "\n ");
27899
+ if (!isContextMenuDisabled && isTouch && !isSelectingShortcut && !draggingItem && !dragState.wasDragged && !dragState.isFocused) {
27899
27900
  setTooltipState(function (prev) {
27900
27901
  return _extends({}, prev, {
27901
27902
  mobileVisible: true
27902
27903
  });
27903
27904
  });
27904
- } else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {
27905
+ } else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch && !dragState.wasDragged && !dragState.isFocused) {
27905
27906
  var event = e;
27906
27907
  setContextMenuState(function (prev) {
27907
27908
  return {