Issue #2827Opened June 12, 2020by AndiswamyDev0 reactions

Couldn't make text editable after running the "editor.getSelected().view.disableEditing()" command? Any alternate command to become editable text?

Question

Hi @artf ,

I'm currently working on customizing link property, So in the mid of my flow, I need to restrict the selected text to become uneditable(to get exact list of text components), by doing so , I couldn't perform further RTE actions (to unlink). I followed our previoues Grapesjs guides and docs regarding Links, editors etc.. But i couldn't get to know how to make text editable again using editor command as i did for disableEditing? Here's my chunk of code,

linkRTEAction.result = function (rte) {
		// insert the link with a specific href value so we can find it later
		rte.exec('createLink', '__new__');
		editor.getSelected().view.disableEditing();
               rte.exec('unlink');

I believe that I can make unlink only after removing the disableEditing property, I need your help ASAP on removing it buddy.

Answers (1)

artfJune 18, 20200 reactions

Just use the editable property (eg. editor.getSelected().set('editable', false))

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.