-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to set position programmatically #21
Comments
Will be added hopefully in the next version |
Hi! How did you set the position programmatically? Can you give an example? I tried this code:
|
The feature is still not implemented, but what that you wrote should work as a work around |
Thanks for sharing! I've introduced code to change css style of the draggable container. function updateTagPosition(left, top) {
let block = document.querySelector(".draggable-container");
let data = JSON.parse(block.getAttribute("draggable-state"));
_.merge(data, {
currentDragPosition: {
left: left,
top: top
}
});
_.merge(data, {
initialPosition: {
left: left,
top: top
}
});
_.merge(data, {
startDragPosition: {
left: left,
top: top
}
});
block.setAttribute("draggable-state", JSON.stringify(data));
block.style.position = "fixed";
block.style.left = left + "px";
block.style.top = top + "px";
} |
this.draggableValue.initialPosition.left= left
this.draggableValue.initialPosition.top = top
this.draggableValue.resetInitialPos = true
this.$nextTick(() => (this.draggableValue.resetInitialPos = false)) I use |
Hi!
sometimes I need to set the position programmatically, for example if the window is resized and the draggable element is left out of it.
I do it modifying the position of element manually and accessing the
draggable-state
viagetAttribute
to change thestartDragPosition
andcurrentDragPosition
, but it's trickyNow is possible? If not, is a possible future feature?
Thank!
The text was updated successfully, but these errors were encountered: