fredsa / gwt-dnd

Library providing easy to use mouse or touch based drag-and-drop capabilities to GWT
42 stars 41 forks source link

standards mode: PickupDragController with RootPanel #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of GWT are you using? 1.3.3? 1.4.60? Other?
1.5.2

What version of the gwt-dnd jar file or library file are you using?
2.5.4

What operating system(s) are you using? Windows? Linux? Mac?
Windows

Does the issue occur in web mode, hosted mode, both or don't know?
Occurs in both hosted and web mode

What browser(s) do you use? Firefox, IE, Safari, other?
Occurs in all of FF, IE, OPERA, CHROME

What steps will reproduce the problem? Please attach sample code if you can.

0. use standards mode:
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

1. create a PickupDragController as follows:
   pickupDragController = new PickupDragController(RootPanel.get(), true);
   pickupDragController.setBehaviorConstrainedToBoundaryPanel(true);
   pickupDragController.setBehaviorMultipleSelection(false);

2. add a window like in demo:
   pickupDragController.makeDraggable(window, header);

3. try to move a window

What is the expected output? What do you see instead?
Window should follow a mouse pointer, but instead it sticks to the top of the 
page.

Do you have a workaround?
Works in quirks mode, but not in standards mode.

Debuging shows wrong/different from expected value of 
PickupDragController.dropTargetClientHeight. In standards mode 
it's only 16, but in quirks mode it is 462 - values are specific to my page, 
but show the point.

Currently dropTargetClientHeight is calculated as
   DOMUtil.getClientHeight(boundaryPanel.getElement())

I've noticed that method
   Window.getClientHeight()
returns in standards mode value near to one in quirks mode - 458

Looking for quick solution:

1. override dragStart():
   - call super.dragStart()
   - set dropTargetClientHeight to Window.getClientHeight()
   this idea fails as dropTargetClientHeight is private

2. override dragMove() writing own version:
   I don't like this idea neither, I would have to copy this complicated method, make my changes and check if 
anything is changed in next releases

Original issue reported on code.google.com by ja.ar...@gmail.com on 14 Sep 2008 at 6:45

GoogleCodeExporter commented 9 years ago
Thanks for the detailed report. Since this was a common issue for gwt-dnd users 
to 
run into, I recently (in gwt-dnd-2.5.5.jar) added a hosted mode runtime check 
for 
this condition. When gwt-dnd detects this situation, it will recommend adding 
the 
following CSS to your application:
  BODY, HTML { height: 100%; }

Original comment by fredsa on 20 Sep 2008 at 7:09