Opened 9 years ago

Closed 9 years ago

#10085 closed bug (notabug)

Cannot return to original height after first resize.

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

Description

This is my example: http://jsfiddle.net/wjS7Z/

I have a element set to a height of 35px, the resize function is set to resize by 40px. After the first resize I cannot return to 35px. If you click the resize handle and slight move the mouse you will see the element jump 5px which seems to be the cause of it not returning to the original height.

However if you switch to jQuery UI 1.10.2 this will work fine.

Change History (3)

comment:1 Changed 9 years ago by Scott González

Owner: set to SFPinkSmartie
Status: newpending

The grid option is really meant for the full size of the resizable. Why are you using a grid that doesn't match the original size?

Last edited 9 years ago by Scott González (previous) (diff)

comment:2 Changed 9 years ago by SFPinkSmartie

Status: pendingnew

In my actual code I have a grid like a calender, with days and times. A user can drag items into this grid from another container. The cells are set to 40px by 110px and the items are set to 35px by 100px. This allows the items to sit inside the cell. A user can resize these items in different times, but to keep the item in the same position I resize by 40px, but allow it to return to its original size.

comment:3 Changed 9 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Hi SFPinkSmartie,

In my opinion, the size of a resizable element should always be a multiple of the grid dimensions. For your use case, I would recommend applying the cell dimensions to the resizable, and using an inner element to achieve the "sit inside the cell" look. Something kind of like this: http://jsfiddle.net/tj_vantoll/hDfg4/. Alternatively you could increase the size of the cells to 45px and make the original resizable 40px.

If others from the community desire this behavior they can comment or vote on this ticket and we can reinvestigate.

Note: See TracTickets for help on using tickets.