1

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');
    }
});
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
zuc0001
  • 924
  • 4
  • 12
  • 27

1 Answers1

1

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.

zuc0001
  • 924
  • 4
  • 12
  • 27
  • 2
    I don't have a reason but I do have a fix. I replaced: `handles: { se: '.resize-handle' }` with `handles: { se: $elem.find('.resize-handle') }` to give it a JQuery object rather than a selector and it worked in 1.11. – GSP Oct 08 '15 at 13:48