@topconsultnpm/sdkui-react 6.21.0-dev1.33 → 6.21.0-dev1.34
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.
|
@@ -8,7 +8,10 @@ const TMDragDropOverlay = (props) => {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
const handleWindowDragEnter = (e) => {
|
|
10
10
|
e.preventDefault();
|
|
11
|
-
|
|
11
|
+
// Attiva solo se si trascina un file
|
|
12
|
+
if (e.dataTransfer?.types.includes('Files')) {
|
|
13
|
+
setDragOver(true);
|
|
14
|
+
}
|
|
12
15
|
};
|
|
13
16
|
const handleWindowDragOver = (e) => {
|
|
14
17
|
e.preventDefault();
|
|
@@ -60,7 +63,9 @@ const TMDragDropOverlay = (props) => {
|
|
|
60
63
|
boxShadow: '0 8px 20px rgba(0,0,0,0.3)',
|
|
61
64
|
backdropFilter: 'blur(5px)',
|
|
62
65
|
transition: 'opacity 0.2s, transform 0.2s, background 0.2s',
|
|
63
|
-
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation();
|
|
66
|
+
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
67
|
+
setDragOver(true); }, onDragOver: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
68
|
+
setDragOver(true); }, onDragLeave: (e) => {
|
|
64
69
|
e.preventDefault();
|
|
65
70
|
e.stopPropagation();
|
|
66
71
|
// Solo se il cursore ha lasciato il div principale
|
|
@@ -54,7 +54,10 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
54
54
|
};
|
|
55
55
|
const handleDragOver = (e) => {
|
|
56
56
|
e.preventDefault();
|
|
57
|
-
|
|
57
|
+
// Attiva solo se si trascina un file, non testo selezionato
|
|
58
|
+
if (e.dataTransfer?.types.includes('Files')) {
|
|
59
|
+
setDragOver(true);
|
|
60
|
+
}
|
|
58
61
|
};
|
|
59
62
|
const handleDragLeave = () => {
|
|
60
63
|
setDragOver(false);
|