moveable
moveable copied to clipboard
Is there a way to re-set elementGuidelines?
Environments
- Framework name: vanilla JS
- Framework version: latest
Description
The elementGuidelines option seems to only work for elements already on the DOM. If I add a new moveable element, elementGuidlines work perfectly when moving that element. However when moving a different element, the elementGuidelines do not work with that latest added element. Is there a way to re-set so that all elements work correctly?
Thanks
Something like this should do the job
const moveable = new Moveable(container, {
elementGuidelines: returnYourGuidelines(),
// ...rest of your config
});
moveable.on('drag', () => {
// set again here
moveable.elementGuidelines = returnYourNewGuidelines();
});
Thanks that helped