@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.
@@ -27826,6 +27826,7 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27826
27826
  }
27827
27827
  });
27828
27828
  });
27829
+ setDraggingItem(null);
27829
27830
  }, [setTooltipState]);
27830
27831
  var handleSuccessfulDrag = React.useCallback(function (quantity) {
27831
27832
  resetDragState();
@@ -27843,22 +27844,21 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27843
27844
  var _dragState$position = dragState.position,
27844
27845
  x = _dragState$position.x,
27845
27846
  y = _dragState$position.y;
27846
- if (Math.abs(data.x - x) > 5 || Math.abs(data.y - y) > 5) {
27847
+ if (Math.abs(data.x - x) > 20 || Math.abs(data.y - y) > 20) {
27847
27848
  setDragState(function (prev) {
27848
27849
  return _extends({}, prev, {
27849
27850
  wasDragged: true,
27850
27851
  isFocused: true
27851
27852
  });
27852
27853
  });
27854
+ } else {
27855
+ resetDragState();
27853
27856
  }
27854
27857
  if (!draggingItem) {
27855
27858
  setDraggingItem(item);
27856
27859
  }
27857
27860
  }, [dragState.position, draggingItem, item, setDraggingItem]);
27858
27861
  var onDraggableStop = React.useCallback(function (e, data) {
27859
- setTimeout(function () {
27860
- setDraggingItem(null);
27861
- }, 50);
27862
27862
  var target = e.target;
27863
27863
  if (!target) return;
27864
27864
  target.classList.remove('react-draggable-dragging');
@@ -27901,13 +27901,14 @@ var useItemSlotDragAndDrop = function useItemSlotDragAndDrop(_ref) {
27901
27901
  }, 50);
27902
27902
  } else if (item) {
27903
27903
  var isTouch = e.type === 'touchend';
27904
- if (!isContextMenuDisabled && isTouch && !isSelectingShortcut && !draggingItem) {
27904
+ console.log("Debug: \n isTouch: " + isTouch + ",\n isSelectingShortcut: " + isSelectingShortcut + ",\n draggingItem: " + draggingItem + ",\n dragState.wasDragged: " + dragState.wasDragged + ",\n dragState.isFocused: " + dragState.isFocused + "\n ");
27905
+ if (!isContextMenuDisabled && isTouch && !isSelectingShortcut && !draggingItem && !dragState.wasDragged && !dragState.isFocused) {
27905
27906
  setTooltipState(function (prev) {
27906
27907
  return _extends({}, prev, {
27907
27908
  mobileVisible: true
27908
27909
  });
27909
27910
  });
27910
- } else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {
27911
+ } else if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch && !dragState.wasDragged && !dragState.isFocused) {
27911
27912
  var event = e;
27912
27913
  setContextMenuState(function (prev) {
27913
27914
  return {