I'm using it on a component editor, it will not work as expected, because I need to switch beeting editing and viewer mode.
Resize functionality is working as expected: By setting an empty array to the "active" prop and it disabled resizing.
It seems that you are listening for changes on dragSelector and calling setupDragElements properly, although you are not removing previously added "drag-el" class.
It means that, once enabled, drag functionality can not be disabled by reseting the dragSelector to undefined.
Hi thank you for sharing your wonderful job.
I'm using it on a component editor, it will not work as expected, because I need to switch beeting editing and viewer mode. Resize functionality is working as expected: By setting an empty array to the "active" prop and it disabled resizing.
It seems that you are listening for changes on dragSelector and calling setupDragElements properly, although you are not removing previously added "drag-el" class.
It means that, once enabled, drag functionality can not be disabled by reseting the dragSelector to undefined.
//fixed version: setupDragElements(selector) { let nodeList = this.$el.getElementsByClassName("drag-el"); while (nodeList.length) nodeList[0].classList.remove("drag-el"); nodeList = this.$el.querySelectorAll(selector); nodeList.forEach((el) => { el.classList.add("drag-el"); }); this.dragElements = Array.prototype.slice.call(nodeList); },
Thank you once again for sharing it