You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to programmatically add an article title as the first component in the editor. I don't want to let the user change this in the editor or move it from the top spot (it's edited elsewhere).
That adds the component as expected, however all the subsequent components I drag in are slotted in above that "heading" component, rather than below. Is there a way to ensure it stays in the top position?
Update:
I noticed that the programmatically-added component is not shown in my layers panel, so it's probably not considered part of the root layer. This would explain why others are added above it. I then attempted this, which add a component, but mostly ends up crashing the editor:
const root = this.editor.Layers.getRoot();
root.append({ ...same config as above });
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking to programmatically add an article title as the first component in the editor. I don't want to let the user change this in the editor or move it from the top spot (it's edited elsewhere).
So far I'm doing this:
That adds the component as expected, however all the subsequent components I drag in are slotted in above that "heading" component, rather than below. Is there a way to ensure it stays in the top position?
Update:
I noticed that the programmatically-added component is not shown in my layers panel, so it's probably not considered part of the root layer. This would explain why others are added above it. I then attempted this, which add a component, but mostly ends up crashing the editor:
Beta Was this translation helpful? Give feedback.
All reactions