Opened 10 years ago
Closed 10 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 10 years ago by
comment:2 Changed 10 years ago by
Patch is not correct. Misunderstood the 'containment' option. Resize is still not working correctly. I'll take a close look
comment:3 Changed 10 years ago by
Owner: | set to PaulSinnema |
---|---|
Status: | new → pending |
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 10 years ago by
Status: | pending → new |
---|
Made a new patch that takes the topScroll() and leftScroll() of the scrollParent() into account.
comment:5 follow-up: 6 Changed 10 years ago by
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.
comment:6 Changed 10 years ago by
Status: | new → pending |
---|
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 10 years ago by
Status: | pending → new |
---|
Yes it covers the irratic behavior I was talking about but not the offset problem.
comment:9 Changed 10 years ago by
Component: | ui.core → ui.resizable |
---|---|
Status: | new → pending |
No, we need a reduced test case. If we can't reproduce it, we can't fix it.
comment:10 Changed 10 years ago by
Status: | pending → new |
---|
I could try and make test case with a kendoGrid in JSFiddle if that's ok?
comment:11 Changed 10 years ago by
Status: | new → pending |
---|
Sorry, that's way too much third party code. Please reduce it to find what is introducing the problem.
comment:12 Changed 10 years ago by
Status: | pending → new |
---|
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 10 years ago by
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 10 years ago by
Status: | new → pending |
---|
comment:15 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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!
Made a fork at: https://github.com/PaulSinnema/jquery-ui