-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fire onresizestop after complete resizing #159
Comments
for a quickfix you can use your caclulation inside setTimeout call with appropriate timeout. More reliable would be using debouncing technique. |
+1 for fixing this issue. |
I came here to open an issue saying the same thing. I would like to get el.dataset.gsHeight and el.dataset.gsWidth in my resizestop event handler, but it fires early before the data-gs-height and data-gs-width attributes have been updated. I'm digging through gridstack.js to locate the source of this out-of-order event or race condition. Any pointers as to where to make the fix would be helpful! Thanks! |
I've dug into it some more. For whatever reason, the This firing behavior seems backwards to me. I would expect the |
This bug report (http://bugs.jqueryui.com/ticket/9580) helped me to identify the problem. Basically, callbacks inside options structures are not event callbacks, they are pure callbacks. The event is fired and all event callbacks are executed, then all options callbacks are executed. The solution is to bind |
Hi all, |
@tazeroualti - @derekm was kind enough to build a fix for this, which has since been merged into gridstack v0.2.5-dev. Though this build is not necessarily stable, it incorporates many bug fixes, and I'd recommend giving it a go to see if it fixes your issue. |
This morning I downloaded the releases zip which includes gridstack 0.2.6. It appears as though the same issue exists. I was under the impression that his had been merged in...what am I missing? Is still in dev only? |
I have this issue in 0.3.0. Looks like the fix went into the 0.2.x branch, and the code in the 0.3.0 is sufficiently different. I'm using the gsresizestop callback and need to use a settimeout to get the new height/width using jquery (not ideal). |
When resizing a widget, the dimensions snap to the grid after the handle is released. This is great. :)
However, it seems that onresizestop() is triggered before that process is finished so if you try to get the widgets dimension, you get them 'wrong'.
Is there a way to get an event that is triggered after the full resizing process?
The text was updated successfully, but these errors were encountered: