Ticket #140 (new defect)

Opened 2 years ago

Last modified 1 year ago

Sortable/DragAndDrop scroll offset

Reported by: luciano@lugmen.org.ar Assigned to: therve@gmail.com
Priority: low Milestone: MochiKit 1.5
Component: component1 Version:
Severity: normal Keywords:
Cc: therve@gmail.com

Description

Scroll propierty of a draggable object does not work as expected when is set to a scrolleable div.

If you have a <div>(with style="overflow:auto"), that contains a sortable list, and that list is so long that makes the <div> to have a scrollbar, and you scroll down to see the lower elements, and try to dragg and drop that elements, the dragged elements suffers an offset(proportial to the scroll offset) and is impossible to drop it on the lower positions of the sortable list.

Simple example attached, tested on Firefox and Konqueror.

<html>
<head>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/MochiKit.js"></script>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/New.js"></script>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/Visual.js"></script>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/Signal.js"></script>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/DragAndDrop.js"></script>
    <script type="text/javascript" src="/js-devel/mochikit/MochiKit/Sortable.js"></script>
</head>
<body>
<div id=main style="width:300px;height:300px;overflow:auto">
    <div id="1" style="padding:20px">
        i'm the div 1
    </div>
    <div id="2" style="padding:20px">
        i'm the div 2
    </div>
    <div id="3" style="padding:20px">
        i'm the div 3
    </div>
    <div id="4" style="padding:20px">
        i'm the div 4
    </div>
    <div id="5" style="padding:20px">
        i'm the div 5
    </div>
    <div id="6" style="padding:20px">
        i'm the div 6
    </div>
    <div id="7" style="padding:20px">
        i'm the div 7
    </div>
    <div id="8" style="padding:20px">
        i'm the div 8
    </div>
    <div id="9" style="padding:20px">
        i'm the div 9
    </div>
</div>
<script type="text/javascript">
    MochiKit.Sortable.Sortable.create('main', {tag:'div',scroll:'main'});
</script>
</body>
</html>

Attachments

100x50.jpg (22.0 kB) - added by anonymous on 04/10/07 21:19:29.

Change History

06/28/06 09:05:17 changed by therve@gmail.com

  • cc set to therve@gmail.com.

Sorry, it's a not (yet) documented feature. You have to set MochiKit.Position.includeScrollOffsets to true if you want to use this kind of draggables. Unfortunately the page will become very slow under Firefox, which explains is not set by default.

Leaving it opened until documented.

04/10/07 21:19:29 changed by anonymous

  • attachment 100x50.jpg added.

05/14/07 17:42:33 changed by rsayre@mozilla.com

therve,

Could you set a milestone for this?

05/15/07 01:50:50 changed by therve@gmail.com

  • owner changed from somebody to therve@gmail.com.
  • priority changed from normal to low.
  • milestone set to MochiKit 1.5.

That's not a blocker I think. Sortable is not even officially supported. I'll do that later.