-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fixes 11135 - resizeable issue with border-box #1451
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
Conversation
If you apply .resizeable() to an element which has border-box sizing and this element has a border then the container will "shrink" by this border size immediately as the resizing drag begins.
alsoResize with border-box sizing
+1 tested, it works great, thank you! |
Any idea how I clear that "CLA error"? I've signed the declaration thing twice but no luck. Also I emailed 'license@jquery.com' and the email bounced. |
Your git config doesn't have your full name, so it's being rejected. You can follow the instructions from the details link to fix the problem. |
@@ -994,8 +997,8 @@ $.ui.plugin.add("resizable", "alsoResize", { | |||
$(exp).each(function() { | |||
var el = $(this); | |||
el.data("ui-resizable-alsoresize", { | |||
width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), | |||
left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) | |||
width: parseInt(el.css("width"), 10), height: parseInt(el.css("height"), 10), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure a proper fix would always use consistent methods. I don't think we should be mixing css( "width" )
and .width()
.
cc @mikesherov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that - you could for example use .css('width') inside _mouseStart() and then wouldn't need to change _applyChanges() (around line 490) - but I didn't know whether it would have wider issues elsewhere. .width() and .css('width') are used inconsistently throughout the code. It would be quite a job to figure out whether these are intentional or not - and what consequences there would be for making things consistent. Stylistically I prefer .css('width') because you can setup a props object and do this.helper.css(props);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put some notes together on width() vs css('width') vs outerWidth() here:
http://jsfiddle.net/ilancopelyn/n911jymr/1/
Have a play around with it and see what you think - there are some subtleties with trying to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
@ilanc can you please fix this CLA thingy? This bug is around for a few years, I really want to see it merged as soon as possible.. |
Hi @razvanphp. I'm having trouble doing this. I've changed my user settings and attempted to It's such a minor fix - feel free to just duplicate the fix in your own branch and ignore my pull request. I'll sort this out if I ever make any future pull request. |
I have duplicated this fix in my own branch. I also signed the CLA. Should I create another pull request or can this one be fixed? |
@ilanc @razvanphp @scottgonzalez what's the status on this? It's not clear if a pull req with a fix has been submitted / accepted. Working using the above fix and a patch for our site but would really love to see this get into a future release and don't want to add to confusion by opening duplicate pull req. |
I still feel strongly that we shouldn't be mixing |
Hi guys. I haven't been following this thread. Use @ilanc if you want me to get notified by email. I thought that @razvanphp was going to resubmit and that this would have been added to the main branch by now. |
as @thisjustin mentioned, I didn't want to add more confusion by creating a new pull request. Also it is clear to me that the CLA thing is not the strongest argument against this PR. Maybe @ilanc can still fix this by a force push. @scottgonzalez if you look at the next line you commented, you will see that before this fix, i.e. |
This is what I dislike about git - it will take the rest of the day for me to figure out how to change the author from my netreturn adddress to my gmail address, just so that the CLA check passes. And I know what's going to happen - it'll still fail even after I figure it out. @razvanphp can you explain what I have to do to update the author info given that I have 2 commits? The advice on the CLA link only describes fixing 1 commit and doesn't seem to work for 2. |
I tried adding my netreturn email address to my github profile instead and even set it as my primary email address. I then resigned the CLA. Unless there is something I need to do in order to get the CLA check to re-run, this appears to not have worked either. |
Am i supposed to use filter-branch or rebase -i? as per: |
@ilanc now that you have your netreturn email registered for CLA, you only have to push a change to the branch so that the CLA check runs again. For this, I suggest you fix the spacing, by using tabs instead of spaces, because this seems to be standard for jquery repos. |
Ok thanks will give it a go |
https://contribute.jquery.org/style-guide/js/#spacing You also need to fix the merge conflicts, btw. |
@razvanphp - now I can't commit?
I tried the following comments with no luck:
|
Looking at the commit history it must start with If he checks for older commits, you might have to rebase unfortunately: |
Guys - like I said - I tried. I'm sorry I can't give up a whole day to checking in 2 lines of code. If that means that this stays unfixed for all eternity then so be it. What an utter waste of time. |
@ilanc then you can close this PR and I will create a new one, starting from current master. Thank you for your time! |
Sorry - I'm really busy with other stuff. Thanks for trying to help. |
Great fix! Solved everything for me. All Cred to you ilanc. |
@ilanc Thanks for the fix! It worked great, until I added |
Is it possible that this bug is still on production? How is it possible? |
Still have this problem. |
I ended up patching manually my version... this is ridicolus |
We will happily accept a complete, working, mergeable PR for this, so far we have not received one. |
This one worked just fine. |
Also used this fix. Would like to see resizable understand border-box without having to use a custom copy and change it. |
I understand why everybody stopped using jQuery in favor of other solutions... lol We have a working PR that doesn't get merged for no reasons. |
If you apply .resizeable() to an element which has border-box sizing and
this element has a border then the container will "shrink" by this
border size immediately as the resizing drag begins.
Unit tests all passing.