Delay retrieving context for conditions (#19271)

* Delay retrieving context for conditions

* Add changeset
This commit is contained in:
Pascal Jufer
2023-07-27 19:51:28 +02:00
committed by GitHub
parent 5c3e7a7a9d
commit 84cbc31d18
3 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/app": patch
---
Resolved browser freeze in field conditions by delaying the retrieving of field context

View File

@@ -40,7 +40,7 @@ const props = defineProps<{
interface?: string;
collection?: string;
disabled?: boolean;
context?: ExtensionOptionsContext;
context?: () => ExtensionOptionsContext;
}>();
const emit = defineEmits<{
@@ -76,7 +76,7 @@ const optionsFields = computed(() => {
if (typeof selectedInterface.value.options === 'function') {
optionsObjectOrArray = selectedInterface.value.options(
props.context ?? {
props.context?.() ?? {
field: {
type: 'unknown',
},

View File

@@ -92,7 +92,7 @@ const repeaterFields = computed<DeepPartial<Field>[]>(() => [
interface: 'system-interface-options',
options: {
interface: interfaceId.value,
context: fieldDetailStore,
context: useFieldDetailStore,
},
},
},