Opened 8 years ago
Last modified 8 years ago
#12868 new bug
Fixed Position Draggable Element Scrolls Offscreen
Reported by: | NMcCloud | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.draggable | Version: | 1.11.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If a fixed position element is made draggable, and that element is then moved beyond the scrollbar region, it will accelerate off screen. The only way this behavior does not occur is if the scroll is already at the top or bottom of the window. Its rather comical.
This used to work in 10.4, which I am trying to migrate from (i.e. it would simply push the element at a constant rate up or down)
<div id="a" style="width:50px;height:100px;position:fixed;top:300px;left:200px;background:red"></div> <div style="width:50px;height:5000px;position:absolute;background:blue"></div> <script> $("#a").draggable(); </script>
Change History (2)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
I hacked the draggable widget (_mouseStart, and _mouseStop), turning off the scroll option if the element being dragged is either fixed or is in a fixed parent. Apparently, the scroll plugin is what is causing the element to accelerate off the screen when the mouse is pulled to the top or bottom of the screen.
See: http://jsbin.com/supuxekuqo/1/edit
Thanks,
Ken
Replying to NMcCloud:
Here is the jsbin: http://jsbin.com/kuhebusixi/1/edit?html,output
Thanks,
Ken