I need to create a selection with native JS or TinyMCE methods.
Currently I have this code that does what is shown in the image below:
const table = editor.dom.getParent(editor.selection.getNode(), 'table');
if (table) {
editor.selection.select(table);
}
I have also tried to do this and it turns out the same as above:
const table = editor.dom.getParent(editor.selection.getNode(), 'table');
if (table) {
const rng = editor.dom.createRng();
rng.selectNode(table);
editor.selection.setRng(rng);
}
I need to make this type of selection with the mouse: