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 {
2525 pluginInstance._registerEvents ();
2626 }
2727
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+ }
2940
3041 void _registerEvents () {
3142 html.window.onDragEnter.listen (
@@ -103,7 +114,7 @@ class DesktopDropWeb {
103114 final enable = call.arguments as bool ;
104115 final current = _dataTransfer? .dropEffect;
105116 final newValue = enable ? 'copy' : 'move' ;
106- if (current != newValue) {
117+ if (current != newValue) {
107118 _dataTransfer? .dropEffect = newValue;
108119 }
109120 return ;
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ class DesktopDrop {
137137 ),
138138 );
139139 }
140+ _channel.invokeMethod ('updateDroppableStatus' , target != null );
140141 }
141142 if (target != null ) {
142143 final position = target.globalToLocalOffset (event.location);
@@ -147,7 +148,6 @@ class DesktopDrop {
147148 }
148149 }
149150 _currentTargetListener = target;
150- _channel.invokeMethod ('updateDroppableStatus' , target != null );
151151 }
152152
153153 void _notifyDoneEvent (DropDoneEvent event) {
You can’t perform that action at this time.
0 commit comments