Ticket #3511 (closed bug: fixed)

Opened 5 years ago

Last modified 18 months ago

Draggable: Incorrect helper checking

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

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.

Change History

comment:1 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r855.

comment:2 Changed 18 months ago by scott.gonzalez

  • Milestone TBD deleted

Milestone TBD deleted

Note: See TracTickets for help on using tickets.