How to moveLayer on component:create #5376
Unanswered
badiuciprian
asked this question in
Q&A
Replies: 1 comment
-
Actually quite simple :) setTimeout(() => {
const dest = editor.getWrapper();
// Get the current parent of the created component
const parent = component.parent();
if (parent && parent === dest) {
// Get the index of the last component in the parent
const lastIndex = parent.components().length - 1;
// Move the created component to the last position (index + 1)
component.move(dest, {at: lastIndex + 1});
}
}, 100); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, I'm trying to reset the layer manager every time I drop a new component, so that the new component is always last in the dom/layer manager. Is there a way to achieve this on component:create? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions