Opened 7 years ago

Closed 7 years ago

#9017 closed bug (cantfix)

When resize "w" or "e" from the left y axis, position of div box is changed - moved

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

Description

When you try to resize "w" or "e" by moving the mouse from the left y axis then the whole box moves from its position. If you do the opposite, resize "e" or "w" by moving the mouse from the right y axis then it behaves correctly, the whole box does not move, it just alters its width!.

Check out demo http://jsfiddle.net/KqAaU/4/

Change History (9)

comment:1 Changed 7 years ago by tj.vantoll

Reduced - http://jsfiddle.net/tj_vantoll/54Zc2/. This is happening because of the margin: auto; on the resizable element. I'm not sure this is something that resizable can or should support.

Anybody else have thoughts?

comment:2 Changed 7 years ago by mikesherov

TJ, I'm sure you're right, but how does margin: auto cause this bug?

comment:3 Changed 7 years ago by tj.vantoll

Whoops forgot to mention that. If you remove the margin: auto; rule or change it to some static value like 50px in my test case above the problem will go away.

comment:4 Changed 7 years ago by arxwn

The problem will go away if you remove the margin:auto; but what if want, when resizing on the left, the box to resize on the right automaticaaly as happenes on http://jsfiddle.net/KqAaU/4/ ?

So the problem is when margin is set to auto or with % value f.e. 80%

comment:5 Changed 7 years ago by arxwn

Check out this: http://jsfiddle.net/KqAaU/5/

try to resize west. the whole box moves on the left. This happens only on this situation, on the opposite (box be on the left side and resize east) does not happen..

comment:6 in reply to:  4 Changed 7 years ago by tj.vantoll

Replying to arxwn:

The problem will go away if you remove the margin:auto; but what if want, when resizing on the left, the box to resize on the right automaticaaly as happenes on http://jsfiddle.net/KqAaU/4/ ?

So the problem is when margin is set to auto or with % value f.e. 80%

Percentage based margins work just fine. Your example is still using margin: auto;, if I change it to a percentage based value it works fine http://jsfiddle.net/tj_vantoll/fsHVG/.

comment:7 in reply to:  5 Changed 7 years ago by tj.vantoll

Replying to arxwn:

Check out this: http://jsfiddle.net/KqAaU/5/

try to resize west. the whole box moves on the left. This happens only on this situation, on the opposite (box be on the left side and resize east) does not happen..

This is a separate issue but it looks the resizable interaction does not handle right correctly http://jsfiddle.net/tj_vantoll/3Rzsu/. Draggable has the same problem (see #7772).

comment:8 Changed 7 years ago by Scott González

Yeah, it's impossible to tell how the user has positioned an element. Interactions always assume left/top.

comment:9 Changed 7 years ago by mikesherov

Resolution: cantfix
Status: newclosed

Hopefully not forever: http://lists.w3.org/Archives/Public/www-style/2013Jan/0492.html

For now, a workaround would be to set the margin equal to the margin before drag. I think this needs to be marked as "cantfix". Someone else reopen if you disagree.

Note: See TracTickets for help on using tickets.