jQuery 1.5 clone() bug can cause issues with jScrollPane

61 views
Skip to first unread message

RwL

unread,
Feb 4, 2011, 8:57:22 AM2/4/11
to jscrollpane
Just a heads-up for Kelvin and any others on the list who may be soon
upgrading to jQuery 1.5 and using jScrollPane, in case this hasn't
been discussed here yet.

There's a bug in 1.5's update to clone() -- http://bugs.jquery.com/ticket/8123
-- where the default arguments (dataAndEvents, deepDataAndEvents) are
supposed to be false but they evaluate as true. This can cause issues
when jScrollPane clones the pane (to measure its width) and then
removes the clone. In my case, I had jQuery UI components inside the
main pane (initialized before jScrollPane) whose 'destroy' method
would get called when their cones were removed from the DOM.

This bug is already fixed and will ship with 1.5.1, but in the
meantime you can prevent problems by finding both uses of clone() in
jScrollPane 2.0 beta 9 and manually adding the arguments: clone(false,
false)

RL

Kelvin Luck

unread,
Feb 4, 2011, 9:16:55 AM2/4/11
to jscro...@googlegroups.com
Hi,

Thanks for the headsup... It seems like it's worthwhile to proof
jScrollPane against this bug so I made the suggested changes:
https://github.com/vitch/jScrollPane/commit/76f0071c4001ffbd602a0c107c18fc297f5917d5

Cheers,

Kelvin :)

Reply all
Reply to author
Forward
0 new messages