#37666 closed defect (bug) (fixed)
Masonry update to v3.3.2 breaks backwards compatibility with isAnimated option
Reported by: | stephenharris | Owned by: | jorbin |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | External Libraries | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In version 2 of Masonry, the isAnimated
(boolean) option configured whether the grid elements were animated. Since WordPress switched to version 3 it has been providing a shim for backwards compatibility. However since #32802 use of that option throws an error:
jquery.masonry.js?ver=3.1.2:29 Uncaught TypeError: Cannot read property 'transitionDuration' of undefined
I'm not sure whether the last v2-shim works with Masonry 3.3.2. The shim was last updated Mar 26 2015 and moved to an external repo on April 1 2015 (where it appears to be unmaintained) which is when version Masonry 3.2.3 was released, and so it may not do so.
If the v2-shim no longer works, and we don't maintain it ourselves, we should probably make developers aware of this.
Attachments (3)
Change History (15)
#2
@
8 years ago
Here's a demonstration of the bug: https://gist.github.com/stephenharris/5dd78b70dd81e082dc169ec4ba5c51c2
I have a patch: simply replace Masonry.prototype.options.transitionDuration
with it's default value ('0.4s'). It's not clear to me why Masonry.prototype.options
is no longer defined, but it would in any case, only store the default values.
Patch to follow.
#4
@
8 years ago
- Keywords has-patch added; reporter-feedback removed
Thanks @stephenharris!
Using this
instead of Masonry.prototype
seems to work too, see 37666.diff. I think the only difference is that it wouldn't fall back to 0.4s
if you initialize Masonry with isAnimated
and transitionDuration
.
@stephenharris Can you please provide some code to reproduce this issue?