Issue #2827💬 AnsweredOpened 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?

快速解答by artf

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

Read full answer below ↓

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, 2020

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.