Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix borders not always toggling back when exiting preview. Fixes #2637 #2689

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

mcottret
Copy link

@mcottret mcottret commented Mar 27, 2020

As described by this issue, the component borders may not be toggled back when exiting preview mode in some cases.

This fixes this issue by adding a shouldRunSwVisibility flag to the Preview command, set via the Commands API on its run (before stopping the sw-visibility command if it's active), & used on stop to reactivate the sw-visibility command if needed.

Which also implies:

  • Prevent toggling of component borders while preview is active
  • Rely on the Commands API to detect if the sw-visibility command is active rather than a panel button
  • Prevent resetting the shouldRunVisibility flag on multiple subsequent (forced) runs / stops of the preview command

…esJS#2637

As described by [this issue](GrapesJS#2637), the component borders may not be toggled back when exiting preview mode in some cases.

This fixes this issue by adding a `shouldRunSwVisibility` flag to the Preview command, set via the Commands API on its run (before stopping the `sw-visibility` command if it's active), & used on stop to reactivate the `sw-visibility` command if needed.

Which also implies:

- Prevent toggling of component borders while preview is active
- Rely on the Commands API to detect if the `sw-visibility` command is active rather than a panel button
- Prevent resetting the `shouldRunVisibility` flag on multiple subsequent (forced) runs / stops of the preview command
@mcottret mcottret changed the title Fix borders not always toggling back when exiting preview. Fixes artf/grapesjs#2637 Fix borders not always toggling back when exiting preview. Fixes #2637 Mar 27, 2020
@artf
Copy link
Member

artf commented Apr 1, 2020

Awesome @mcottret thank you very much ❤️

@artf artf merged commit 864068e into GrapesJS:dev Apr 1, 2020
@mcottret mcottret deleted the fix/fix-preview-borders-toggling branch July 6, 2020 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants