Issue #2770Opened May 13, 2020by tiptronic855 reactions

[QUESTION] Set selected element

Question

Hello, is there a way to select an element after added to the body? When i add a link, i want to open the Component Settings immediately.

How can i do it ?

Thank you in advance

Answers (2)

Mohsen-KhakbizMay 13, 20203 reactions

I think this should work

editor.on('component:mount', function(model) {
	editor.select(model);
	const openBl = editor.Panels.getButton('views', 'open-tm');
	openBl && openBl.set('active', 1)
});
tiptronic85May 14, 20202 reactions

It works, thank you a lot. I add the code only for links and button and it is perfect.

if model.is('link')

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.