zuc0001
zuc0001

Reputation: 930

jQuery resizable handle inside child

I am receiving this error:

Uncaught TypeError: Cannot read property 'ownerDocument' of undefined

when I try to place my resizable handle inside a child of the container I am trying to resize.

Code

As you can see, it is currently inside the controls div, however the handle is meant to resize the .ui-widget container, however it is instead throwing the above error.

If I move the handle outside of the controls div however, it works fine.

Why is this happening? Is there a workaround?

Current jQuery code:

$("div.ui-widget").resizable({
    handles: {
        'se': 'div.ui-resizable-se'
    },
    start: function(e, ui) {
        $(ui.helper).addClass("dragging");
    },
    stop: function(e, ui) {
        $(ui.helper).removeClass("dragging");
        oldWidget.saveState($(ui.helper), 'resize');
    }
});

Upvotes: 1

Views: 1091

Answers (1)

zuc0001
zuc0001

Reputation: 930

Found the solution myself.

It seems that it was the JqueryUI version causing it! I was using 1.11.x and after reverting to 1.10.4 the problem is gone and it functions correctly!

Any reasons why are greatly appreciated.

Upvotes: 1

Related Questions