Vidal Graupera
2008-Jun-23 23:48 UTC
Problem with Sortable.create scroll (also Draggable scroll)
Hi, I am trying to use the "scroll" property of Sortable (which I know just passes through Draggable) to scroll a div that contains a list. The list is a Sortable and when someone scrolls an element off the top or bottom I need the container to scroll. This works fine *except* when you drag an element off the top (or bottom) of the container. The element you are dragging will flicker, and behave weirdly. Take the element at the top of the list, move it up a few pixels and just hold it with mouse down. It will "float" up as well. I have verified this on FF3, Safari and IE. It works fine when scroll property is set to window, but I need to use a containing div instead. I am using latest scriptaculous from github and prototype 1.6.0.2. Here is an excerpt of the relevant parts of my code that shows this problem. Any help appreciated, or a working example would be greatly appreciated. Thanks, Vidal. <script type="text/javascript"> //<![CDATA[ document.observe("dom:loaded", function() { Position.includeScrollOffsets = true; Sortable.create(''sortable_items'',{ scroll: ''your_spin_list'' }); // this fails too var mydrag = new Draggable(''test'', { scroll: ''your_spin_list'' }); }); //]]> </script> <style> #your_spin_list {overflow:scroll; height: 200px;} </style> </head> <body> <div id="your_spin_list"> <ol id="sortable_items"> <li>blah blah blah</li> <li>one two three four</li> <li>alpha beta gamma delta</li> <li>scriptaculous prototype yui etc</li> </ol> <span id="test">dragging this also off the top misbehaves</span> </div> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
markb
2008-Jun-26 09:44 UTC
Re: Problem with Sortable.create scroll (also Draggable scroll)
I experienced the same problem on my current. The problem can not be solved with the current library I think. What is causing the strange behaviour when you try to drag an element into or out of the ''your_spin_list'' is the overflow:scroll for that element. Get rid of it and everything should behave normal again. I read the same conclusion in the prototype bungee book''... it just isnt possible to drag things in or out of containers that have an overflow set to scroll. Sorry.. On Jun 24, 1:48 am, Vidal Graupera <vgraup...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am trying to use the "scroll" property of Sortable (which I know > just passes through Draggable) to scroll a div that contains a list. > The list is a Sortable and when someone scrolls an element off the top > or bottom I need the container to scroll. > > This works fine *except* when you drag an element off the top (or > bottom) of the container. The element you are dragging will flicker, > and behave weirdly. Take the element at the top of the list, move it > up a few pixels and just hold it with mouse down. It will "float" up > as well. > > I have verified this on FF3, Safari and IE. It works fine when scroll > property is set to window, but I need to use a containing div instead. > I am using latest scriptaculous from github and prototype 1.6.0.2. > > Here is an excerpt of the relevant parts of my code that shows this > problem. Any help appreciated, or a working example would be greatly > appreciated. > > Thanks, > > Vidal. > > <script type="text/javascript"> > //<![CDATA[ > > document.observe("dom:loaded", function() { > Position.includeScrollOffsets = true; > Sortable.create(''sortable_items'',{ > scroll: ''your_spin_list'' > }); > > // this fails too > var mydrag = new Draggable(''test'', { scroll: ''your_spin_list'' }); > > }); > > //]]> > </script> > <style> > #your_spin_list {overflow:scroll; height: 200px;} > </style> > > </head> > > <body> > > <div id="your_spin_list"> > <ol id="sortable_items"> > <li>blah blah blah</li> > <li>one two three four</li> > <li>alpha beta gamma delta</li> > <li>scriptaculous prototype yui etc</li> > </ol> > > <span id="test">dragging this also off the top misbehaves</span> > </div>--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---