Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Ext.net.ProxyDDCreator: problem dragging elements if not CSS position: relative #1240

Open

Description

@fabriciomurta

In the example Drag Drop - Basic Example 1, unless the CSS class dd-item has position: relative setting, dropping the item 1.2 or 1.3 the first time they are dragged drops the item shifted by their positions in the yellow div.

This happens because Ext.util.Positionable receives the drop offset and sets it to a relative position from the element's original position. But if that element does not contain a left + top CSS position and it is not relative-positioned already, the method takes again the into account el.dom.offsetLeft (and -Top) in a isNaN test, and then adds that offset to the relative position movement.

This is the code snippet in ext-all-debug.js (from Ext.util.Positionable.translateXY() that defines the miscalculation:

       if (isNaN(left)) {
            left = relative ? 0 : el.dom.offsetLeft;
        }
        if (isNaN(top)) {
            top = relative ? 0 : el.dom.offsetTop;
        }
        left = (typeof x === 'number') ? x - xy[0] + left : undefined;
        top = (typeof y === 'number') ? y - xy[1] + top : undefined;

At that point, el.dom offset (in the above mentioned example) is the offset in relation to the yellow box, not window/page/viewport.

This is not clearly a Sencha ExtJS bug as the Ext.net.ProxyuDDCreator is used and might be the culprit of the issue.

This issue was spotted on #1217.54

Activity

  1. added this to the milestone on Jan 23, 2016
  2. modified the milestones: Release 4.0.0-preview, on Feb 14, 2016
  3. modified the milestones: Release 4.0.0-beta, on Mar 8, 2016
  4. removed this from the milestone on Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions