RickStrahl / jquery-resizable

A small jQuery plug-in to make DOM components resizable
MIT License
234 stars 91 forks source link

`destroy()` should also reset `width` and `height` #51

Open av01d opened 5 months ago

av01d commented 5 months ago

When calling destroy on an instance, the css width and height values remain. They should be removed. Fix is this: change

$handle = getHandle(opt.handleSelector, $el);
$handle.off("mousedown." + opt.instanceId + " touchstart." + opt.instanceId);
if (opt.touchActionNone)
   $handle.css("touch-action", "");
$el.removeClass("resizable");
return;

to this

$handle = getHandle(opt.handleSelector, $el);
$handle.off("mousedown." + opt.instanceId + " touchstart." + opt.instanceId);
if (opt.touchActionNone)
   $handle.css("touch-action", "");
$el.removeClass("resizable");
$el.css({width:'', height:''});
return;