Issue #690💬 AnsweredOpened December 28, 2017by TWCM0 reactions

Preview Command bug: exit the preview mode will run the sw-visibility command, when the sw-visibility stopped before go to preview mode.

Quick answerby TWCM

Hi @artf, I found that the command running sequence when click the preview button: Is it a bug ? this running sequence make me cannot get the correct classname of canvas' body. so cannot store the state before run the preview command. I cannot make a further development.

Read full answer below ↓

Question

Hi @artf , The case is "switch-visibility" command stopped, then click the preview button or trigger preview command, it will go to preview mode, when exit the preview mode, the "sw-visibility" command ran, it haven't save the state before go to preview mode and cannot reset the visibility after stop the preview command.

Answers (3)

TWCMDecember 29, 2017

Hi @artf, I found that the command running sequence when click the preview button: Is it a bug ? this running sequence make me cannot get the correct classname of canvas' body. so cannot store the state before run the preview command. I cannot make a further development.

artfDecember 29, 2017

@tommywulove I tried this in the demo

editor.on('run:preview', () => console.log('run preview'))
editor.on('stop:preview', () => console.log('stop preview'))

and the sequence seems correct

TWCMDecember 29, 2017

@artf but why i click the preview button, it will trigger the stop command once , then run the command ?

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.