Skip to main content

Search and Top Navigation

#2776 closed bug (fixed)

Opened May 02, 2008 05:27PM UTC

Closed July 01, 2008 07:33PM UTC

Last modified August 26, 2009 02:00PM UTC

Sortables - Dragged Item Position Skewed on Right-Click

Reported by: wjchristenson2 Owned by: paul
Priority: minor Milestone: 1.5
Component: ui.sortable Version: 1.5b4
Keywords: Sortable Cc:
Blocked by: Blocking:
Description

Browser: IE 7

jQuery: 1.2.4a

jQuery UI: 1.5b2

js: ui.sortable.js

When you drag a sortable item over another sortable item's drag handle and right click, the sortable item you were dragging is dropped but not in the placeholder (correct location). At this point the placeholder is still at the original location of the dragged item and the dragged item is dropped where you right-clicked.

$(document).ready(function(){
	$("#zone_0").sortable({
	  items: 'div.wf_widget',
		handle: 'div.wf_widget_header',
		revert: false,
		scroll: true,
		placeholder: 'wf_widget_dropcue',
		connectWith: $('div.wf_zone'),
		opacity: 0.7,
		stop: function() { stopSort(); },
		dropOnEmpty: true,
		helper: function() { return $("#helper").clone().show(); },
		zIndex: 10000
	});

	$("#zone_1").sortable({
	  items: 'div.wf_widget',
		handle: 'div.wf_widget_header',
		revert: false,
		scroll: true,
		placeholder: 'wf_widget_dropcue',
		connectWith: $('div.wf_zone'),
		opacity: 0.7,
		stop: function() { stopSort(); },
		dropOnEmpty: true,
		helper: function() { return $("#helper").clone().show(); },
		zIndex: 10000
	});
});
    <div>
    
    <table>
        <tr><td>Zone 0:</td><td>Zone 1:</td></tr>
        <tr>
            <td style="vertical-align: top;">
                <%--zone 0--%>
                <div id="zone_0" class="wf_zone">
                    <%--widget 0--%>
                    <div id="widget_0" class="wf_widget">
                        <div class="wf_widget_header">widget 0</div>
                        <div class="wf_widget_content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla laoreet euismod odio. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum dictum tortor at sapien. Aliquam erat volutpat. Duis vel metus at magna sodales suscipit. Integer risus diam, dignissim vitae, ornare ut, vestibulum ut, augue. Nam sollicitudin congue lectus. Curabitur lacus. Integer est. Morbi vel sapien quis pede tempus dignissim. Etiam at libero eu sem posuere aliquam. Sed id nibh. Vestibulum consequat dui vel orci.</div>
                    </div>
                    
                    <%--widget 1--%>        
                    <div id="widget_1" class="wf_widget">
                        <div class="wf_widget_header">widget 1</div>
                        <div class="wf_widget_content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla laoreet euismod odio.</div>
                    </div>
                </div>
            </td>
            <td style="vertical-align: top;">
                <%--zone 1--%>
                <div id="zone_1" class="wf_zone">
                    <%--widget 2--%>
                    <div id="widget_2" class="wf_widget">
                        <div class="wf_widget_header">widget 2</div>
                        <div class="wf_widget_content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla laoreet euismod odio.</div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    </div>
    
    <div id="helper" style="border: solid 1px red;display: none;">helper</div>
Attachments (0)
Change History (6)

Changed May 03, 2008 08:25AM UTC by paul comment:1

priority: majorminor

I couldn't reproduce the issue on http://dev.jquery.com/view/trunk/ui/demos/ui.sortable.html.

Can you check if it happens here, too?

Changed May 05, 2008 01:32PM UTC by wjchristenson2 comment:2

Replying to [comment:1 paul]:

I couldn't reproduce the issue on http://dev.jquery.com/view/trunk/ui/demos/ui.sortable.html. Can you check if it happens here, too?

I also could not reproduce the issue on the demo link. However I can reproduce it consistently on the code attached. It may be related to a handle and/or a helper (I'm using both in the example).

Changed May 24, 2008 03:39AM UTC by comment:3

milestone: 1.2.4

Milestone 1.2.4 deleted

Changed May 24, 2008 07:23PM UTC by paul comment:4

component: ui.coreui.sortable
version: 1.2.31.5b4

Changed July 01, 2008 07:33PM UTC by paul comment:5

resolution: → fixed
status: newclosed

Should be fixed with 1.6 (branches/1.6/ui.sortable.js).

Changed February 26, 2009 12:15PM UTC by paul comment:6

milestone: → 1.5