Opened 6 years ago

Closed 6 years ago

#9509 closed bug (invalid)

no negative position left exist on resize event

Reported by: xerel Owned by: xerel
Priority: minor Milestone: none
Component: ui.resizable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I find what it seems to be an error. I was creating a script with jquery ui resizable on jsfiddle which works normally but not on live page. After search i saw that i hadn't use the same version of jquery ui.

My script work on 1.9.2, but not on 1.10.3.

With 1.9.2 the size of the resized element with "w" handle seems to be originalSize+originalPosition-position = size,including negative left position value

Where as with the 1.10.3 there isn't negative value for ui.left.position if i resize to the right so my calcs does'nt works.

Let's see in image and values on the console debug: Ui 1.9.2 http://jsfiddle.net/xerel/Y2UP5/ Ui 1.10.3 http://jsfiddle.net/xerel/Y2UP5/

Sorry for my bad english!

Change History (3)

comment:1 Changed 6 years ago by xerel

As i needed of this function without comeback on the 1.9.2 jquery ui version, i have try to debug myself.

It seems to come from of the resize method of resizable containment callback function here With my change come closer of the version 1.9.2 but not enought

   if (cp.left < (that._helper ? co.left : 0)) {
             /**original**/
             that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
             /**my change**/            
              that.size.width = that.originalSize.width - that.position.left; //#1
            if (pRatio) {
                that.size.height = that.size.width / that.aspectRatio;
            }


           /**original**/
            that.position.left = o.helper ? co.left : 0; 
           /**my change**/
            that.position.left = o.helper ? co.left : cp.left; //#2
        }

comment:2 Changed 6 years ago by tj.vantoll

Owner: set to xerel
Status: newpending

Hi xerel,

The change was due to this commit that landed in 1.10.3: https://github.com/jquery/jquery-ui/commit/6df5c1a4ae738e591694e0fe2fa3bbb8b05f6b0a#ui/jquery.ui.resizable.js.

I'm still not sure this is a bug though. Why would the left ever by negative?

comment:3 Changed 6 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.