@rpg-engine/long-bow 0.8.56 → 0.8.58
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 +14 -6
- 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 +14 -6
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ConfirmModal.tsx +17 -6
package/package.json
CHANGED
|
@@ -23,15 +23,20 @@ export const ConfirmModal: React.FC<IConfirmModalProps> = ({
|
|
|
23
23
|
onClose,
|
|
24
24
|
message = 'Are you sure?',
|
|
25
25
|
}) => {
|
|
26
|
-
|
|
26
|
+
// Add a small delay to prevent accidental closes
|
|
27
|
+
const handleConfirm = (e: React.MouseEvent | React.TouchEvent) => {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
e.stopPropagation();
|
|
27
30
|
onConfirm();
|
|
28
31
|
};
|
|
29
32
|
|
|
30
|
-
const handleClose = () => {
|
|
33
|
+
const handleClose = (e: React.MouseEvent | React.TouchEvent) => {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
e.stopPropagation();
|
|
31
36
|
onClose();
|
|
32
37
|
};
|
|
33
38
|
|
|
34
|
-
const stopPropagation = (e: React.
|
|
39
|
+
const stopPropagation = (e: React.MouseEvent | React.TouchEvent) => {
|
|
35
40
|
e.stopPropagation();
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -40,7 +45,12 @@ export const ConfirmModal: React.FC<IConfirmModalProps> = ({
|
|
|
40
45
|
<GlobalStyle />
|
|
41
46
|
<Overlay onClick={handleClose} />
|
|
42
47
|
<ModalContainer>
|
|
43
|
-
<ModalContent
|
|
48
|
+
<ModalContent
|
|
49
|
+
onClick={stopPropagation}
|
|
50
|
+
onTouchStart={stopPropagation}
|
|
51
|
+
onTouchEnd={stopPropagation}
|
|
52
|
+
onTouchMove={stopPropagation}
|
|
53
|
+
>
|
|
44
54
|
<MessageContainer>
|
|
45
55
|
{typeof message === 'string' ? (
|
|
46
56
|
<Message>{message}</Message>
|
|
@@ -53,14 +63,14 @@ export const ConfirmModal: React.FC<IConfirmModalProps> = ({
|
|
|
53
63
|
<CancelButtonWrapper>
|
|
54
64
|
<Button
|
|
55
65
|
buttonType={ButtonTypes.RPGUIButton}
|
|
56
|
-
|
|
66
|
+
onClick={handleClose}
|
|
57
67
|
>
|
|
58
68
|
No
|
|
59
69
|
</Button>
|
|
60
70
|
</CancelButtonWrapper>
|
|
61
71
|
<Button
|
|
62
72
|
buttonType={ButtonTypes.RPGUIButton}
|
|
63
|
-
|
|
73
|
+
onClick={handleConfirm}
|
|
64
74
|
>
|
|
65
75
|
Yes
|
|
66
76
|
</Button>
|
|
@@ -81,6 +91,7 @@ const Overlay = styled.div`
|
|
|
81
91
|
z-index: 1000;
|
|
82
92
|
animation: fadeIn 0.2s ease-out;
|
|
83
93
|
cursor: pointer;
|
|
94
|
+
touch-action: none;
|
|
84
95
|
|
|
85
96
|
@keyframes fadeIn {
|
|
86
97
|
from {
|