Preview Command bug: exit the preview mode will run the sw-visibility command, when the sw-visibility stopped before go to preview mode.
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)
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.
@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
@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.
Issue #668
When element not available to select, suggest hover and click event will select the available parent.
Hi @artf, can i have a enhancement for select command, when the cursor click or hover the element which is not selectable, then the selecti...
Issue #1767
Ensure that getHtml() / runCommand("gjs-get-inlined-html") returns the very latest contents of the canvas
Hi @artf , I ran into a similar, if not the same issue as this one: #1327 While editing a text block, I click on an external button to get...
Issue #1951
[QUESTIONS] change or add event on add component from block
is it possible ?, change the drag and drop event to on click when adding a new component, I want to add components by clicking the block th...
Issue #1081
[BUG] - removePanel does not remove panels
I'm trying to remove a panel. The function returns the panel the first time I run removePanel and then returns undefined if I run it again....
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.