Opened 11 years ago
Closed 10 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)
Change History (16)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
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 11 years ago by
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.
comment:4 Changed 11 years ago by
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?
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:
comment:5 Changed 11 years ago by
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 11 years ago by
Attachment: | EDG-drag.png added |
---|
comment:6 Changed 11 years ago by
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:8 Changed 11 years ago by
Cc: | David Schwartz added; drschwarz removed |
---|
comment:9 Changed 11 years ago by
comment:10 Changed 11 years ago by
Does this patch completely fix the issue? If so, we can close it as such.
comment:11 Changed 11 years ago by
Keywords: | EnhancedGrid added |
---|
comment:12 Changed 10 years ago by
Owner: | changed from Evan to evan |
---|
comment:13 Changed 10 years ago by
Milestone: | future → 1.6 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
This issue no longer exists in 1.6 - trying dnd test case
Investigating.