Issue #1322💬 AnsweredOpened July 27, 2018by YashPrince0 reactions

Disable editing in Preview Mode.

Quick answerby jvillena

You can use: editor.stopCommand('sw-visibility'); editor.runCommand('sw-visibility');

Read full answer below ↓

Question

@artf How can we disable editing in the preview mode and re-enable it when preview mode off. I want to remove editor and hide toolbar in the preview mode so that user can only view the changes and can not edit it also all the editable option should be come when user stop the preview mode.

Answers (3)

jvillenaJuly 27, 2018

You can use: editor.stopCommand('sw-visibility'); editor.runCommand('sw-visibility');

YashPrinceJuly 27, 2018

@jvillena I have used this code but it is not working.

editor.on('run:preview', () => { editor.stopCommand('sw-visibility'); });

editor.on('stop:preview', () => editor.runCommand('sw-visibility'); });

ghostJuly 27, 2018

Hi Artur ( @artf ),

I need to add save and publish button so is there any plugin available or do i need to hardcoded. Can you please help me.

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.