Skip to main content

Search and Top Navigation

#3511 closed bug (fixed)

Opened October 24, 2008 01:23PM UTC

Closed November 03, 2008 11:25AM UTC

Last modified October 11, 2012 09:15PM UTC

Draggable: Incorrect helper checking

Reported by: vlesierse Owned by: paul
Priority: minor Milestone:
Component: ui.draggable Version: 1.6rc2
Keywords: draggable Cc:
Blocked by: Blocking:
Description

For my solution I assign the helper as a function. This function modifies the draggable element by setting its position to absolute.

See my example:

$(element).draggable({
    helper: function(e) { return $(this).css("position", "absolute"); }
});

This results in that after I dropped the element it will remove my element because of a check inside the clear function of the draggable extension. It checks if the option is not original but in my opinion it should check if the element not equels the helper. See my suggestion below:

_clear: function() {
    this.helper.removeClass("ui-draggable-dragging");
    if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove();
    //if($.ui.ddmanager) $.ui.ddmanager.current = null;
    this.helper = null;
    this.cancelHelperRemoval = false;
},

To

_clear: function() {
    this.helper.removeClass("ui-draggable-dragging");
    if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
    //if($.ui.ddmanager) $.ui.ddmanager.current = null;
    this.helper = null;
    this.cancelHelperRemoval = false;
},

This will fix my problems because I would like to drag the original because it could contain object or embed tags for Flash and Silverlight. Only when it is set to relative I cannot move the element from one column to another.

Attachments (0)
Change History (2)

Changed November 03, 2008 11:25AM UTC by paul comment:1

resolution: → fixed
status: newclosed

Fixed in r855.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted