Can't select the model using editor.select()
Question
I am trying to select the first component in the editor by using editor.select(editor.DomComponents.getComponents().models[0]). It is not working.
Answers (3)
@artf , @pouyamiralayi :I need this condition inside the 'canvas:drop' event editor.on('canvas:drop', ()=>{ ... ... // My code to select the first component is here //... ... })
@naveen-15697 you can achieve this with:
editor.on('block:drag:stop', (m) => {
if(m){
editor.select(editor.getComponents().models[0])
}
})
cheers!
@pouyamiralayi Thanks! It's working now.
@artf , But, Why it is not working in 'canvas:drop' event?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2549
[QUESTION] Update component view on property change
Hi everyone, I'm trying to create a component that will update it's view based on a property value My approach is bassed on #1227 and on th...
Issue #3014
BUG: Move component from Child
Hi, i'm trying to make custom components composed with other components. No problem to do that. I'm facing an issue when i want to move the...
Issue #1998
Extending Link component not working properly.
hello @hello @artf I am trying to extend the link component and add new traits like href and target the code is given below. `function load...
Issue #1091
How to select the first Component
I want to launch the editor with the style manager visible and populated. Meaning that a component is selected by default and the style man...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.