Skip to content

Commit

Permalink
fix: registering blocks rendered in a proxy field
Browse files Browse the repository at this point in the history
  • Loading branch information
dulnan committed Nov 12, 2024
1 parent f71e469 commit f74f5a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime/composables/defineBlokkli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
INJECT_FIELD_LIST_TYPE,
INJECT_REUSABLE_OPTIONS,
INJECT_PROVIDER_BLOCKS,
INJECT_FIELD_USES_PROXY,
} from '../helpers/symbols'
import {
computed,
Expand Down Expand Up @@ -143,8 +144,12 @@ export function defineBlokkli<

const isEditing = !!item?.value.isEditing

const fieldUsesProxy = inject(INJECT_FIELD_USES_PROXY, false)

onMounted(() => {
if (
// If the field uses proxy mode we don't want to register the block here.
fieldUsesProxy ||
!item?.value ||
!isEditing ||
!editContext ||
Expand All @@ -170,6 +175,8 @@ export function defineBlokkli<

onBeforeUnmount(() => {
if (
!fieldUsesProxy &&
isEditing &&
editContext &&
editContext.dom &&
uuid &&
Expand Down

0 comments on commit f74f5a4

Please sign in to comment.