Issue #2003Opened May 8, 2019by Jogai0 reactions

[Question] How to select a specific element nested inside a template

Question

My test case: https://codepen.io/jogai/pen/QRjKyN?editors=1111

I want to select the middle column so I thought I can use selectorManager.get() but its not selecting what I'm expecting.

I supply the class name (because id doesn't work anyway) and the element with that class name has 4 images. but if I look in the collection I cant see the child elements.

Do I use it wrong? Should I initialize the selectorManager with other options?

Answers (3)

artfMay 11, 20190 reactions

SelectorManager is meant for managing Selector entities (eg adding, updating and removing classes) not for selecting components. In your case, you should do this:

editor.on('load', () => {
	editor.select(editor.getWrapper().find('.finder')[0])
});
JogaiMay 11, 20190 reactions

Thanks for clearing up my misunderstanding!

lock[bot]May 21, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.