[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)
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])
});
Thanks for clearing up my misunderstanding!
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.
Issue #1137
Cant make Text Block not editable and style able at the same time !
Demo / reproduce problem https://jsfiddle.net/shareefhiasat/u8Lodyh7/1/ Question Not sure if its bug or i dont know how to get the desired...
Issue #1409
Component Drag Event
I want to know how can I get that component from which element is dragged and drop to the other component. I need to add a class if compone...
Issue #1869
[QUESTION] how to add extra field in input traits
Hi, I want to add the new field in default input traits. for example:- i need to add {label: binding, name:binding} in already exist input...
Issue #1702
[Question]How to get rte selection inside the result function
I'm basically trying to put an input fieldinside the RTE so that users can make link more easily. console.log(<a href="#">${rte.selection()...
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.