aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/draggable/core.js17
-rw-r--r--ui/widgets/draggable.js4
-rw-r--r--ui/widgets/mouse.js2
3 files changed, 20 insertions, 3 deletions
diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js
index 8bc751e0e..9efe9d3f1 100644
--- a/tests/unit/draggable/core.js
+++ b/tests/unit/draggable/core.js
@@ -345,4 +345,21 @@ test( "ui-draggable-handle managed correctly in nested draggables", function( as
assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" );
} );
+test( "does not stop propagation to window", function( assert ) {
+ expect( 1 );
+ var element = $( "#draggable1" ).draggable();
+
+ var handler = function() {
+ assert.ok( true, "mouseup propagates to window" );
+ };
+ $( window ).on( "mouseup", handler );
+
+ element.simulate( "drag", {
+ dx: 10,
+ dy: 10
+ } );
+
+ $( window ).off( "mouseup", handler );
+} );
+
} );
diff --git a/ui/widgets/draggable.js b/ui/widgets/draggable.js
index f61c38ce0..b459afe00 100644
--- a/ui/widgets/draggable.js
+++ b/ui/widgets/draggable.js
@@ -255,7 +255,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
if ( !noPropagation ) {
var ui = this._uiHash();
if ( this._trigger( "drag", event, ui ) === false ) {
- this._mouseUp( {} );
+ this._mouseUp( new $.Event( "mouseup", event ) );
return false;
}
this.position = ui.position;
@@ -322,7 +322,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
cancel: function() {
if ( this.helper.is( ".ui-draggable-dragging" ) ) {
- this._mouseUp( {} );
+ this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
} else {
this._clear();
}
diff --git a/ui/widgets/mouse.js b/ui/widgets/mouse.js
index 938d0f4b7..1d8458b27 100644
--- a/ui/widgets/mouse.js
+++ b/ui/widgets/mouse.js
@@ -189,7 +189,7 @@ return $.widget( "ui.mouse", {
}
mouseHandled = false;
- return false;
+ event.preventDefault();
},
_mouseDistanceMet: function( event ) {
master-update-psalm-baseline'>automated/noid/master-update-psalm-baseline Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/version.php
blob: d5452bb0ab23d46e89e516aab5d6b06a1c59c952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53