Opened 6 years ago

Closed 6 years ago

#9535 closed bug (invalid)

resizable() does not take scrollposition of containment into account

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

Description

Hi,

I'm quite new to jQuery UI but not to jQuery. We use the Kendo UI from Telerik to build our website. We are currently building a gantt chart inside a row of the Kendo UI grid. The problem here is that the rows can be scrolled horizontally and vertically. When the grid is at position 0, 0 the resizable() function works flawlessly but as soon as I start scrolling the postion of the sizing element is calculated wrong in the _mouseStart. I've created a patch for it. I've pasted it below.

Regards Paul

_mouseStart: function(event) {

var curleft, curtop, cursor,

o = this.options, iniPos = this.element.position(), el = this.element;

this.resizing = true;

bugfix for http://dev.jquery.com/ticket/1749 if ( (/absolute/).test( el.css("position") ) ) {

el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });

} else if (el.is(".ui-draggable")) {

var scrollLeft = 0; var scrollTop = 0; if (o.containment) {

scrollLeft = o.containment.scrollLeft(); scrollTop = o.containment.scrollTop();

} el.css({ position: "absolute", top: iniPos.top + scrollTop, left: iniPos.left + scrollLeft});

}

Change History (15)

comment:1 Changed 6 years ago by PaulSinnema

comment:2 Changed 6 years ago by PaulSinnema

Patch is not correct. Misunderstood the 'containment' option. Resize is still not working correctly. I'll take a close look

comment:3 Changed 6 years ago by tj.vantoll

Owner: set to PaulSinnema
Status: newpending

Hi PaulSinnema,

When you update this please include a reduced test case that shows the issue you're experiencing. You can use this as a starting point: http://jsfiddle.net/tj_vantoll/82Ka5/.

comment:4 Changed 6 years ago by PaulSinnema

Status: pendingnew

Made a new patch that takes the topScroll() and leftScroll() of the scrollParent() into account.

comment:5 Changed 6 years ago by PaulSinnema

Tried to reproduce the problem but can't. I do see some irratic behavior when resizable() and draggable() are combined as can be observed here: http://jsfiddle.net/82Ka5/3/. Just test my patch locally and there still is a problem. The way we use it is in a cell of a grid (kendoGrid). The left offset of the cell is not taken into account by the resizable() meaning that the resize stops when it reaches the its calculated size from the left which starts at 0 instead of the offset to the last cell to the left of the cell that contains the object to be resized.

Last edited 6 years ago by PaulSinnema (previous) (diff)

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

Status: newpending

Replying to PaulSinnema:

Tried to reproduce the problem but can't. I do see some irratic behavior when resizable() and draggable() are combined as can be observed here: http://jsfiddle.net/82Ka5/3/. Just test my patch locally and there still is a problem.

#6939 covers that issue.

comment:7 Changed 6 years ago by PaulSinnema

Status: pendingnew

Yes it covers the irratic behavior I was talking about but not the offset problem.

comment:8 Changed 6 years ago by PaulSinnema

Can I attach a video?

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

Component: ui.coreui.resizable
Status: newpending

No, we need a reduced test case. If we can't reproduce it, we can't fix it.

comment:10 Changed 6 years ago by PaulSinnema

Status: pendingnew

I could try and make test case with a kendoGrid in JSFiddle if that's ok?

comment:11 Changed 6 years ago by Scott González

Status: newpending

Sorry, that's way too much third party code. Please reduce it to find what is introducing the problem.

comment:12 Changed 6 years ago by PaulSinnema

Status: pendingnew

Just removed the draggable() from the elements in our application. Now the resize seems to work OK. I guess you were right after all. It is the same issue. As soon as I activate the draggable() together with the resizable() things start going wrong.

comment:13 Changed 6 years ago by PaulSinnema

Just tried the work arround in that ticket. It does not help me. This solution also does not take the offset from the cell into account. I think I better drop it.

comment:14 Changed 6 years ago by Scott González

Status: newpending

comment:15 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.