Hi Darren,

I am facing the same problem. I tried adding
"Position.includeScrollOffsets = true;" after "Position.prepare();" in
Droppables.fire(), Draggable.updateDrag(), and Draggable.scroll() but
still I am facing the same problem. I have a div container with
overflow:auto style. I am trying to drag elements from a top container
on to bottom div container. When I scroll down the div container and try
dropping the elements, they either get dropped at different location
(these location also include Droppable.add) or don't get dropped at all.
I also tried looking for http://dev.rubyonrails.org/ticket/5174 but
could not find the page. Any help will be much appreciated. Thanks!


Ruby on Rails: Talk wrote in post #823880:
> If anyone is interested and having the same problem ... I think I have
> solved this by using the following information (taken from
> http://dev.rubyonrails.org/ticket/5174):
>
> I made the additions to dragdrop.js and all seems to be working now!
>
> ->>
>
> The following defect was noticed from Script.Aculo.us versions 1.5.3
> to 1.6.1.
>
> I have a DIV container which has a set width and height. It is set to
> auto-scroll with "overflow: auto" style. It contains a bunch of
> Droppable elements (with onHover/onDrop events and some options
> parameters). I noticed that if I scroll the container to reveal a
> Droppable element at the bottom, when I drag a Draggable element to
> it, the code somehow thinks the Droppable element is a certain
> distance higher in the container. The vertical distance in error is
> the same as the scrolled distance. Therefore, when I drop the element,
> it goes to the wrong Droppable area in another location.
>
> I have looked at dragdrop.js, particularly the Droppables.isAffected()
> and Droppables.show() methods. They are using prototype's
> Position.within() method to detect if the mouse event position is
> within any Droppable element's boundaries. However, by default,
> Position.within() method does not use its "includeScrollOffsets"
> boolean member. This boolean member is set to false by default and I
> couldn't find anywhere in the prototype.js that sets it to true.
>
> My work-around for now is to find "Position.prepare();" string within
> dragdrop.js, and manually add "Position.includeScrollOffsets = true;"
> at the next line. This seems to have fixed the above issue. The three
> places I've updated are Droppables.fire(), Draggable.updateDrag(), and
> Draggable.scroll().
>
> Of course, because of my limited knowledge of prototype and
> Script.Aculo.us, there may be much better solution to the issue. I'm
> looking forward to seeing this issue getting resolved in your later
> releases. Thanks!

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to