File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ export default {
165
165
this .treeModel .startDrag (this .node .id );
166
166
},
167
167
onDragOver (event ) {
168
- if (! this .canDrag ) {
168
+ if (! this .dragEnabled ) {
169
169
return ;
170
170
}
171
171
@@ -182,7 +182,7 @@ export default {
182
182
this .ghost .parentNode .removeChild (this .ghost );
183
183
this .ghost = null ;
184
184
}
185
- if (! this .canDrag ) {
185
+ if (! this .dragEnabled ) {
186
186
return ;
187
187
}
188
188
Original file line number Diff line number Diff line change @@ -445,6 +445,26 @@ describe("FinderItem", () => {
445
445
446
446
expect ( dataTransfer . dropEffect ) . toBeUndefined ( ) ;
447
447
} ) ;
448
+
449
+ it ( "should set dataTransfer.dropEffect = `all` if `dragEnabled` is a function returning `false`" , async ( ) => {
450
+ const dataTransfer = { } ;
451
+ const wrapper = mount ( FinderItem , {
452
+ propsData : {
453
+ treeModel,
454
+ node,
455
+ dragEnabled : ( ) => false ,
456
+ options : {
457
+ canDrop : ( ) => true
458
+ }
459
+ }
460
+ } ) ;
461
+
462
+ await wrapper . trigger ( "dragover" , {
463
+ dataTransfer
464
+ } ) ;
465
+
466
+ expect ( dataTransfer . dropEffect ) . toBe ( "move" ) ;
467
+ } ) ;
448
468
} ) ;
449
469
450
470
describe ( "dragend" , ( ) => {
You can’t perform that action at this time.
0 commit comments