File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/desktop_drop/lib Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,18 @@ class DesktopDropWeb {
25
25
pluginInstance._registerEvents ();
26
26
}
27
27
28
- html.DataTransfer ? _dataTransfer;
28
+ html.DataTransfer ? __dataTransfer;
29
+
30
+ html.DataTransfer ? get _dataTransfer => __dataTransfer;
31
+
32
+ set _dataTransfer (html.DataTransfer ? newValue) {
33
+ if (__dataTransfer != newValue) {
34
+ if (__dataTransfer != null ) {
35
+ newValue? .dropEffect = __dataTransfer! .dropEffect;
36
+ }
37
+ __dataTransfer = newValue;
38
+ }
39
+ }
29
40
30
41
void _registerEvents () {
31
42
html.window.onDragEnter.listen (
@@ -103,7 +114,7 @@ class DesktopDropWeb {
103
114
final enable = call.arguments as bool ;
104
115
final current = _dataTransfer? .dropEffect;
105
116
final newValue = enable ? 'copy' : 'move' ;
106
- if (current != newValue) {
117
+ if (current != newValue) {
107
118
_dataTransfer? .dropEffect = newValue;
108
119
}
109
120
return ;
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ class DesktopDrop {
137
137
),
138
138
);
139
139
}
140
+ _channel.invokeMethod ('updateDroppableStatus' , target != null );
140
141
}
141
142
if (target != null ) {
142
143
final position = target.globalToLocalOffset (event.location);
@@ -147,7 +148,6 @@ class DesktopDrop {
147
148
}
148
149
}
149
150
_currentTargetListener = target;
150
- _channel.invokeMethod ('updateDroppableStatus' , target != null );
151
151
}
152
152
153
153
void _notifyDoneEvent (DropDoneEvent event) {
You can’t perform that action at this time.
0 commit comments