-
-
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
resizestop reports old size #398
Comments
I have investigated this issue. It seems (in my case) the $('.grid-stack-item').on('resizestop', ...) handler gets called before the gridstack handler (by jquery?) and the gridstack handler doesnt trigger my handler. Here is a jsfiddle: https://jsfiddle.net/2uxpbt6y/4/ Thanks in advance for any help on this issue! |
Alright, I found something that works for me. I added an additional if statement at the end of "onEndMoving" line 1106: |
Yep, running into this issue as well. Adding the resizedone event fixed it for me too. |
@radiolips i also faced that problem and solution from @amxbc works for me . And'dragstop' event is similar with 'resizestop' when returns wrong size. |
Update : |
I have same issue on this, using 0.26, init code
Dnd resize 6 -> 5, but these lines give different results: console.debug(ui.element[0].attributes.getNamedItem("data-gs-width")); -> |
So do I, the workaround I /was/ using was to get the size of the dashed outline through something like:
but evidently that is not robust, since the outline div looks to be disappearing before my event handler fires. |
Bit more progress. I've been running into this issue when I've had animate turned on in the options. Waiting to run the event handler until after the animation completes seems to be a workaround. Ex:
It would be nice though to be able to attach to jQuery UI events in a convenient way. |
Remember that time that I came in and fixed a ridiculously old bug that caused everyone grief? Enjoy Please reopen if it still doesn't fix the bug for you. *Make sure to listen to |
I know that this issue has been reported previously (#159) and was fixed, but for me (with a fresh clone of the git repo) this problem is still present.
The following code:
$('.grid-stack').on('resizestop', function (event, ui) {
console.debug(ui.element[0].attributes.getNamedItem("data-gs-width"));
console.debug(ui.element[0].attributes.getNamedItem("data-gs-width").value);
});
reports the size of the gridstack-item before resizing it. I checked the .js and in the top comment it says " * gridstack.js 0.2.5", so this should be fixed?
The text was updated successfully, but these errors were encountered: