Set selected by element or id (not model)
Question
Is it possible to set selected content in editor by passing an element or element id instead passing a model?
Answers (1)
const selector = '#itvmm';
editor.select(editor.DomComponents.getWrapper().find(selector)[0]);
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3137
When I select an particular element I'm not getting its styles. This issue happens only with some elements.
Not getting styles of the selected element Here is my code, const model = editor.StyleManager.getModelToStyle(component); let styleObject =...
Issue #3363
Set content function empties the component content
I am trying to use the set function to change the content of a component, but actually the result is an empty component with nothing inside...
Issue #3242
When Style Manager is in another div, the message "Select an element before using Style Manager" is not showing
Version: 0.16.34 What is the expected behavior? When the editor is initialized, no element is selected, so the style manager should say "Se...
Issue #2762
[QUESTION] How to listen to trait value change directly from block add
I'm passing following JSON to editor.BlockManager.add() function to define my block, load it's content from the server and populate select-...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.