-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback after layoutComplete executed too early #732
Comments
I'm sorry to see you're having trouble with Masonry. Could you provide a reduced test case? See Submitting Issues in the contributing guidelines. |
Here you go. If you click on "Football", then on "5 Kilometers" (in that order), the count of the other "distance" classes doesn't update. If you run the same selector by hand (the part that is being run inside the updatecount() function), it seems to work fine. |
(FYI, I changed sotope v1 Ah, yes. This appears to be a bug 🪲 When no items need to be moved after a filter, then Thank you for reporting this. Unfortunately I do not have a solution at the moment. I'll add this to the work queue for Isotope v2.1 |
Oh sorry, no clue what happened, the example was working for me (now it isn't anymore :-D). Thank you for your time. I will try it with a timeout for now, I'm hoping that should work. |
I've run into the same problem. The layoutComplete callback happens before the onTransitionEnd event which will call the Item.prototype.hide() function. When layout is complete I am checking if there are categories of items without an entry and hide the category.
I've also come across http://stackoverflow.com/questions/5433862/callback-for-jquery-plugin-isotope where people have similar problems, and the accepted answer is
Would you say that that's a good workaround until you can implement in isotope itselfl? |
Yes, that works! |
+ Added `revealComplete` and `hideComplete` events + Removed `instance` argument from `layoutComplete` and `removeComplete` events add hide/reveal test; Ref metafizzy/isotope#732
Isotope v2.2.0 has been released with a new event |
I am using arrangeComplete event, but it seems that it is triggering too early. I just set a timeout for 1 sec and it returns fine! Please test. |
arrange complete not fired at all.
|
I've still got the same issue. Both |
@Kwapi Please open a new issue with a reduced test case. See Submitting Issues in the contributing guidelines. |
Hi,
I'm using the filter functionality, with a callback function to update item count for each filter. I'm triggering an updatecount() function on layoutComplete, as such:
While this works fine in most combinations, sometimes my updatecount() function returns an element count that is incorrect. I've isolated the issue to the selector incorrectly returning elements that are set to hidden. If I run the same selector by hand after the layout has finished updating, the returned value is correct (doesn't return hidden elements). So I can only assume the "callback" is being run before the layout has been completely updated?
The text was updated successfully, but these errors were encountered: