I am trying to select the first component in the editor by using editor.select(editor.DomComponents.getComponents().models[0]). It is not working.
select the first component in the editor
editor.select(editor.getComponents().models[0])
cheers!
select the first component in the editor
editor.select(editor.getComponents().models[0])cheers!
@pouyamiralayi , I tried this too. But it is not working.
@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?
I think the selection is cleared somewhere after canvas:drop, I'll try to check it later