')
+ .addClass("ui-resizable-handle")
+ .addClass("ui-resizable-w")
+ .append($('
'))
+ );
+
+ var handle = '.ui-resizable-w div', target = $('#resizable1').resizable({ handles: 'all' });
+
+ TestHelpers.resizable.drag(handle, -50);
+ equal( target.width(), 150, "compare width" );
+
+ TestHelpers.resizable.drag(handle, 50);
+ equal( target.width(), 100, "compare width" );
+});
+
+test("handle with complex markup, and draggable (#8757)", function() {
+ expect(2);
+
+ $('#resizable1')
+ .append(
+ $('
')
+ .addClass("ui-resizable-handle")
+ .addClass("ui-resizable-w")
+ .append($('
'))
+ );
+
+ var handle = '.ui-resizable-w div', target = $('#resizable1').draggable().resizable({ handles: 'all' });
+
+ TestHelpers.resizable.drag(handle, -50);
+ equal( target.width(), 150, "compare width" );
+
+ TestHelpers.resizable.drag(handle, 50);
+ equal( target.width(), 100, "compare width" );
+});
+
})(jQuery);
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 7a6d8e2e668..a91f2dbfa94 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -67,7 +67,7 @@ $.widget("ui.draggable", $.ui.mouse, {
var o = this.options;
// among others, prevent a drag on a resizable-handle
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle') || $(event.target).closest('.ui-resizable-handle').length > 0)
return false;
//Quit if we're not on a valid handle
diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js
index 13f6c71d06d..c2ad2871623 100644
--- a/ui/jquery.ui.resizable.js
+++ b/ui/jquery.ui.resizable.js
@@ -231,14 +231,15 @@ $.widget("ui.resizable", $.ui.mouse, {
},
_mouseCapture: function(event) {
- var handle = false;
+ var capture = false;
for (var i in this.handles) {
- if ($(this.handles[i])[0] == event.target) {
- handle = true;
+ var handle = $(this.handles[i])[0];
+ if (handle == event.target || $.contains(handle, event.target)) {
+ capture = true;
}
}
- return !this.options.disabled && handle;
+ return !this.options.disabled && capture;
},
_mouseStart: function(event) {