Opened 10 years ago

Closed 9 years ago

#9920 closed defect (worksforme)

Enhanced grid drag/drop not following mouse

Reported by: Adam Peller Owned by: evan
Priority: high Milestone: 1.6
Component: DojoX Grid Version: 1.3.2
Keywords: EnhancedGrid Cc: David Schwartz, Eugene Lazutkin
Blocked By: Blocking:

Description

Click to select a row. Click in the middle vertically of the row and drag. Where you drop will depend on the upper-left corner (top edge) of the row. It should depend on the actual mouse location.

Also, as you first move the mouse to drag down a few pixels, the visual location will be slightly upwards a few pixels from the original location.

See #9287

Attachments (3)

gridDrag.png (51.3 KB) - added by bill 10 years ago.
picture of grid drag
dojoDnD.png (10.5 KB) - added by bill 10 years ago.
screenshot of standard dojo drag
EDG-drag.png (18.9 KB) - added by David Schwartz 10 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 10 years ago by David Schwartz

Investigating.

comment:2 Changed 10 years ago by bill

Specifically it seems to work based on the top edge of the dragged row. Easy to see in http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/enhanced/test_enhanced_grid.html the Easy listening row.

I also noticed that dragging is completely different than standard dojo DnD... specifically that the drag avatar (which is just a gray semi-transparent rectangle) is under the cursor rather than the standard DnD avatar which is below and to the right of the cursor. Standard Dojo DnD separates the avatar from the cursor so that the cursor can generate mouseenter/mouseleave events on potential drop nodes.

Besides this behavior being non-standard (which might be considered bad from a usability/aesthetic point of view), I'm guessing it means I can't drag rows from the grid and drop them on another component, like Tree?

comment:3 Changed 10 years ago by David Schwartz

I don't understand '... specifically that the drag avatar (which is just a gray semi-transparent rectangle) is under the cursor rather than the standard DnD avatar which is below and to the right of the cursor.' FYI, we're changing the drop behavior to be based on the mouse position and not the avatar's position. We're also working to fixed the initial drag behavior.

Changed 10 years ago by bill

Attachment: gridDrag.png added

picture of grid drag

Changed 10 years ago by bill

Attachment: dojoDnD.png added

screenshot of standard dojo drag

comment:4 Changed 10 years ago by bill

Hmm, well maybe some screenshots will help. Here's a screenshot of standard dojo dragging. The cursor is the hand icon, and the drag avatar is the small rectangle with the green left arrow and the letter "A". Do you see how the cursor and the drag icon *don't* overlap?

screenshot of standard dojo drag

Now here's a screenshot of dragging on the grid. The "drag avatar" in this case is the lighter blue rectangle. The cursor is *over* the blue rectangle:

picture of grid drag

comment:5 Changed 10 years ago by David Schwartz

The drag operation won't be as the example illustrate for 1.4. Is there something that identifies the behavior in the example as THE Dojo drag paradigm? IMHO, there's nothing wrong with the avatar being under the cursor. In fact, I would argue that, as it simulates real-world dragging, the avatar's position relative to the mouse pointer should remain stable throughout the drag operation (as it will in what we deliver and as it does in lots of user interfaces). So to be clear, the drop target will be above the 'Black Sabbath' row in the image I'm posting.

If there's consensus that the example really does represent a Dojo standard, we can pursue that for 1.5. RE: "Standard Dojo DnD separates the avatar from the cursor so that the cursor can generate mouseenter/mouseleave events on potential drop nodes", this will be what happens in 1.4, i.e., the drop target will be based on the pointer location (as described above), not the avatar location (as it is currently implemented).

Changed 10 years ago by David Schwartz

Attachment: EDG-drag.png added

comment:6 Changed 10 years ago by bill

Cc: Eugene Lazutkin added

I was hoping the standard was obvious from looking at http://download.dojotoolkit.org/release-1.3.2/dojo-release-1.3.2/dojo/tests/dnd/ all the dojo.DnD tests, as well as all the DnD supporting widgets such as http://download.dojotoolkit.org/release-1.3.2/dojo-release-1.3.2/dijit/tests/tree/test_Tree_DnD.html tree and http://download.dojotoolkit.org/release-1.3.2/dojo-release-1.3.2/dojox/layout/tests/test_GridContainer.html GridContainer. Unfortunately it isn't documented on docs.dojocampus.org.

Ignoring the issue of consistency, just looking at the problem technically, you will need to follow the dojo.DnD standard for grid rows to be able to be dropped onto other drop containers, like Tree nodes.

The exception to the pattern, BTW, is "drag-move" objects where you aren't dropping one object onto another. Those are handled with the dragged object under the mouse.

comment:7 Changed 10 years ago by Nathan Toone

Milestone: tbdfuture

Moving these grid bugs to future.

comment:8 Changed 10 years ago by Adam Peller

Cc: David Schwartz added; drschwarz removed

comment:9 Changed 10 years ago by Adam Peller

(In [20472]) From Evan Huang (IBM, CCLA) The drop target will be based on the pointer location, not the avatar location. The current implementation uses dojo.dnd.moveable, so it might take some time to rework this for a "standard" DnD behavior Refs #9920 !strict

comment:10 Changed 10 years ago by Nathan Toone

Does this patch completely fix the issue? If so, we can close it as such.

comment:11 Changed 10 years ago by Nathan Toone

Keywords: EnhancedGrid added

comment:12 Changed 9 years ago by bill

Owner: changed from Evan to evan

comment:13 Changed 9 years ago by evan

Milestone: future1.6
Resolution: worksforme
Status: newclosed

This issue no longer exists in 1.6 - trying dnd test case

Note: See TracTickets for help on using tickets.