Skip to content

Commit

Permalink
[4.x] Fix Revealer state issues when closing live preview (#9797)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite authored Mar 27, 2024
1 parent 2a19b01 commit d77c8c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions resources/js/components/live-preview/LivePreview.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>

<div>
<v-portal :to="livePreviewFieldsPortal" :disabled="!previewing">
<v-portal :to="livePreviewFieldsPortal" :disabled="!portalEnabled">
<provider :variables="provides">
<slot name="default" />
</provider>
Expand Down Expand Up @@ -101,6 +101,7 @@ export default {
data() {
return {
portalEnabled: false,
panesVisible: false,
headerVisible: false,
editorWidth: null,
Expand Down Expand Up @@ -185,7 +186,13 @@ export default {
watch: {
previewing(enabled) {
previewing(enabled, wasEnabled) {
if (wasEnabled && !enabled) {
this.$nextTick(() => this.portalEnabled = false);
} else {
this.portalEnabled = enabled;
}
if (!enabled) return;
this.update();
Expand Down

0 comments on commit d77c8c5

Please sign in to comment.