Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3503 (new defect)

Opened 2 years ago

Last modified 2 years ago

Problem with drag and drop on IE when element of the page are replaced by AJAX calls

Reported by: anonymous Assigned to: thomas@fesch.at
Priority: normal Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords:
Cc:

Description

I have experienced this problem only on Internet Explorer.

I have a page with a sidebar and main area. The main area is updated via Ajax calls from links in the sidebar. When the main area is updated and removes elements that have been referenced in a call to "drop_receiving_element" (rails) drags of objects from the sidebar fail with an error.

I have tracked this error down to a problem when enumerating through the list of droppable objects.

I can "resolve" this problem (sorry, HIDE it) by altering the prototype Enum.each method to drop all errors (have not got time at the moment to investigate, when I do, I will post more information.)

Attachments

dragdropbug.html (2.1 kB) - added by anonymous on 07/21/06 09:14:24.
Demonstration of the bug.

Change History

01/16/06 12:01:10 changed by peter.morris@ntlworld.com

Sorry, forgot to leave an email address. :-/

Cheers, P.

07/21/06 09:14:24 changed by anonymous

  • attachment dragdropbug.html added.

Demonstration of the bug.

07/21/06 09:14:59 changed by rebanekettu@luukku.com

The error seems to appear, when elements are removed from the DOM (with $('content').innerHTML = ) before calling Droppables.remove(id). When remove() is called, the remove() doesn't get a handle to the element based on the id (since it has been removed). Thus remove() doesn't actually remove the droparea from Droppables.drops variable.

A fix is to execute

Droppables.drops = [];

before recreating the contents, but after the previous contents have been removed. I found the fix from http://public.transcraft.co.uk/articles/development/ie_ajax_dragdrop.html.

See attachment for demonstration.