Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#9547 closed bug (fixed)

Resizable: off-by-one pixel dimensions with helper and grid

Reported by: wch Owned by: wch
Priority: minor Milestone: 1.10.4
Component: ui.resizable Version: 1.10.0
Keywords: regression Cc:
Blocked by: Blocking:

Description

This happens with 1.10.3: http://jsfiddle.net/winstonchang/nCAkM/

But not with 1.9.2: http://jsfiddle.net/winstonchang/dfqtt/

This happens when a helper is used; if it's not used, then the problem doesn't happen.

Change History (13)

comment:1 Changed 5 years ago by tj.vantoll

Owner: set to wch
Status: newpending

Hi wch,

Thanks for taking the time to contribute to the jQuery UI project. I'm not seeing the problem you're describing. I altered your test case to output the height and width of the element and it appears to be working correctly: http://jsfiddle.net/tj_vantoll/czkeF/.

Maybe I'm just missing something. Could you please alter my test case to show the issue you're seeing?

comment:2 Changed 5 years ago by tj.vantoll

Also if you are seeing the issue in my test case us know what browser you're seeing it in. Thanks.

comment:3 Changed 5 years ago by wch

Status: pendingnew

Hi - I am able to reproduce it with your example. The trick is to click on the corner, move the mouse until the frame shows up (but don't actually change to a different size) and then let go of the button. That's when it happens. This occurs for me in Chrome and Firefox.

Also, in your example, the displayed values for Height and Weight don't change, even though the box shrinks each time.

comment:4 Changed 5 years ago by hadley

Possibly related, if you make the border very thick (as in http://jsfiddle.net/hyGBh/), it doesn't line up with the resulting box size.

Last edited 5 years ago by hadley (previous) (diff)

comment:5 Changed 5 years ago by tj.vantoll

Keywords: regression added
Status: newopen
Summary: resizable results in off-by-one pixel dimensions when helper is usedResizable: off-by-one pixel dimensions with helper and grid
Version: 1.10.31.10.0

The behavior starts in 1.10.0 so I'm guessing this is a regression caused by https://github.com/jquery/jquery-ui/commit/6e0a0553ce85997e4f37597800b440b1e4371b5b. I haven't confirmed that though.

comment:7 Changed 5 years ago by Kris Borchers

Resolution: fixed
Status: openclosed

Resizable: Store size based on calculated helper size to prevent 1 pixel shifts. Fixes #9547 - Resizable: off-by-one pixel dimensions with helper and grid

Changeset: 14065dc23bb453b6c30138f225c9db728dd7e455

comment:8 Changed 5 years ago by tj.vantoll

#9667 is a duplicate of this ticket.

comment:9 Changed 5 years ago by Kris Borchers

Resizable: Store size based on calculated helper size to prevent 1 pixel shifts. Fixes #9547 - Resizable: off-by-one pixel dimensions with helper and grid (cherry picked from commit 14065dc23bb453b6c30138f225c9db728dd7e455)

Changeset: e29e5b56afea5a0250636d9c9fd97106732bfe84

comment:10 Changed 5 years ago by Scott González

Milestone: none1.10.4

comment:11 Changed 4 years ago by zvesp

Is this supposed to be fixed in 1.10.4? I'm observing behaviour like that described http://jsfiddle.net/9x5Zt and http://jqueryui.com/resizable/#helper

comment:12 Changed 4 years ago by Scott González

That demos doesn't even use a grid. If you're experiencing this problem, please provide a new test case showing the problem.

comment:13 Changed 4 years ago by zvesp

http://jsfiddle.net/9x5Zt/1/

The same behaviour occurs in helper, in the demos, which is why I linked to it. -- Having glanced at the source code I saw ghost and helper were related, so thought this might be relevent. Apologies if it was unnecessarily off-topic, and deserving of a separate ticket.

Note: See TracTickets for help on using tickets.