# Sortable\_element problem in scrollable div

**URL:** <https://www.ruby-forum.com/t/sortable-element-problem-in-scrollable-div/72113>\
**Category:** Rails\
**Created:** [October 14, 2006, 11:15am UTC](https://www.ruby-forum.com/t/sortable-element-problem-in-scrollable-div/72113 "2006-10-14T11:15:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JermWorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JermWorm](https://www.ruby-forum.com/u/JermWorm)\
**Post date:** [October 14, 2006, 11:15am UTC](https://www.ruby-forum.com/t/sortable-element-problem-in-scrollable-div/72113/1 "2006-10-14T11:15:42Z")

</div>

If I use scrollable\_element on a long list inside a div which is  
scrollable, the moment I click on one of the items without even moving  
the mouse it jumps up to a higher position (IE & Firefox), if i drag  
and drop the dropped element is moved higher than where I dropped.

I suspect that this has something to do with drag and drop relying on  
mouse position within the whole page and not on the position within the  
containing element.

Also it would be nice if the list would scroll automatically if i drag  
the item towards the top/bottom of the list. I could use move up/move  
down links in the rows as a last resort but drag and drop is so much  
friendlier if the row needs to move up/down by multiple rows.

Any ideas …

Before any one suggests [I can see the flames a mile away 🙂] I  
should avoid using a scrollable div, I have already considered that and  
it won’t be viable in the app I’m writing as the customer insists the  
‘header’ and ‘footer’ details remain visible (e.g. Customer, Supplier  
Info in header/scrollable details/totals and buttons at bottom). To be  
honest I tend to agree with them because if there is one thing I hate  
about most web page designs is scrolling down to read a document and  
having to scroll back up again to get at the top/sidebar menu. That is  
fine as a fallback but not acceptable when the browser supports  
scrolling divs/iframes/whatevers.

---

<div class="post-metadata">

**Author:** ![JermWorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JermWorm](https://www.ruby-forum.com/u/JermWorm)\
**Post date:** [October 14, 2006, 11:19am UTC](https://www.ruby-forum.com/t/sortable-element-problem-in-scrollable-div/72113/2 "2006-10-14T11:19:43Z")

</div>

I meant sortable\_element not scrollable\_element

---

<div class="post-metadata">

**Author:** ![JermWorm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JermWorm](https://www.ruby-forum.com/u/JermWorm)\
**Post date:** [October 14, 2006, 11:51am UTC](https://www.ruby-forum.com/t/sortable-element-problem-in-scrollable-div/72113/3 "2006-10-14T11:51:44Z")

</div>

Ok Ok, RTM I know, I did a search before I posted but obviously not  
with the right terms, After another search I found the correct  
documentation and solved my problem.
