@rpg-engine/long-bow 0.7.46 → 0.7.48
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.
- package/dist/long-bow.cjs.development.js +8 -3
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +8 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +13 -3
package/package.json
CHANGED
|
@@ -142,6 +142,7 @@ export const ItemSlot = React.memo(
|
|
|
142
142
|
const [contextActions, setContextActions] = useState<IContextMenuItem[]>(
|
|
143
143
|
[]
|
|
144
144
|
);
|
|
145
|
+
const [isDragStarted, setIsDragStarted] = useState(false);
|
|
145
146
|
|
|
146
147
|
useEffect(() => {
|
|
147
148
|
setDragState(prev => ({
|
|
@@ -200,6 +201,7 @@ export const ItemSlot = React.memo(
|
|
|
200
201
|
|
|
201
202
|
const onDraggableStop: DraggableEventHandler = (e, data) => {
|
|
202
203
|
setDraggingItem(null);
|
|
204
|
+
setIsDragStarted(false);
|
|
203
205
|
|
|
204
206
|
const target = e.target as HTMLElement;
|
|
205
207
|
if (!target) return;
|
|
@@ -266,18 +268,24 @@ export const ItemSlot = React.memo(
|
|
|
266
268
|
}));
|
|
267
269
|
}
|
|
268
270
|
}, 50);
|
|
269
|
-
} else if (item && !
|
|
271
|
+
} else if (item && !isDragStarted) {
|
|
270
272
|
let isTouch = false;
|
|
271
273
|
if (
|
|
272
274
|
!isContextMenuDisabled &&
|
|
273
275
|
e.type === 'touchend' &&
|
|
274
|
-
!isSelectingShortcut
|
|
276
|
+
!isSelectingShortcut &&
|
|
277
|
+
!dragState.wasDragged
|
|
275
278
|
) {
|
|
276
279
|
isTouch = true;
|
|
277
280
|
setTooltipState(prev => ({ ...prev, mobileVisible: true }));
|
|
278
281
|
}
|
|
279
282
|
|
|
280
|
-
if (
|
|
283
|
+
if (
|
|
284
|
+
!isContextMenuDisabled &&
|
|
285
|
+
!isSelectingShortcut &&
|
|
286
|
+
!isTouch &&
|
|
287
|
+
!dragState.wasDragged
|
|
288
|
+
) {
|
|
281
289
|
setContextMenuState(prev => ({
|
|
282
290
|
...prev,
|
|
283
291
|
visible: !contextMenuState.visible,
|
|
@@ -305,6 +313,8 @@ export const ItemSlot = React.memo(
|
|
|
305
313
|
return;
|
|
306
314
|
}
|
|
307
315
|
|
|
316
|
+
setIsDragStarted(true);
|
|
317
|
+
|
|
308
318
|
if (onDragStart && containerType) {
|
|
309
319
|
onDragStart(item, slotIndex, containerType);
|
|
310
320
|
}
|