javier ramirez
2006-Aug-22 18:54 UTC
[Rails-spinoffs] scriptaculous sortable element not clipping the invisible part on a div with scroll
Hi, I found a problem (and working solution) for incorrect clipping for sortable list within a scrolling div. I have a div, with a height of 200px. And inside the div i have a list <ul> with several elements, exceeding the maximum height of the containing div. The div is set to auto overflow (i.e., it will add scroll bars when necessary, clipping the invisible area and displaying only the specified height). Everything is cake so far and everything is working as expected. Until I try to make the list sortable. When I do so, the list elements display as if the div had no overflow property, so they get out of the containing div, floating over the other elements in mi page. Trying to set via javascript the height of both div and list after making the list sortable doesn''t help. My solution for this problem was not using the list element finally, but making the div itself sortable. In the div instead of using <li> for the elements I use <p> (since i don''t have a list already). After that, everything is fine. The part outside the limits of the div keeps invisible until scrolling. The only fallout -that i could appreciate- of this approach is you have to explicitly pass the "tag" parameter, since we are not using the default <li> tag. This behavior was tested both on IE and Mozilla with equal results. Maybe this problem rings a bell for someone who knows the code well enough and it could be patched. In the meantime, the workaround is just fine. cheers, j --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---