Skip to content

Commit 89bfb0b

Browse files
committed
if we are in dynamic context then always prefer the VerticalLayout over the Group
1 parent 72e17d0 commit 89bfb0b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/vue-vuetify/src/complex/ObjectRenderer.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ import {
3333
import cloneDeep from 'lodash/cloneDeep';
3434
import isEmpty from 'lodash/isEmpty';
3535
import isObject from 'lodash/isObject';
36-
import { defineComponent, provide } from 'vue';
36+
import { defineComponent, inject, provide } from 'vue';
3737
import { useNested, useVuetifyControl } from '../util';
3838
import { AdditionalProperties } from './components';
39-
import { UseDefaultValueKey } from '@/util/inject';
39+
import { IsDynamicPropertyContext } from '@/util/inject';
4040
4141
const controlRenderer = defineComponent({
4242
name: 'object-renderer',
@@ -52,14 +52,17 @@ const controlRenderer = defineComponent({
5252
5353
const nested = useNested('object');
5454
55+
const isDynamic = inject<boolean>(IsDynamicPropertyContext, false);
56+
5557
// do not use the default value but the undefind so that
5658
// the property is cleared when property clear action is executed
57-
provide(UseDefaultValueKey, false);
59+
provide(IsDynamicPropertyContext, false);
5860
5961
return {
6062
...control,
6163
input: control,
6264
nested,
65+
isDynamic,
6366
};
6467
},
6568
computed: {
@@ -78,7 +81,7 @@ const controlRenderer = defineComponent({
7881
detailUiSchema(): UISchemaElement {
7982
const uiSchemaGenerator = () => {
8083
const uiSchema = Generate.uiSchema(this.control.schema, 'Group');
81-
if (isEmpty(this.control.path)) {
84+
if (isEmpty(this.control.path) || this.isDynamic) {
8285
uiSchema.type = 'VerticalLayout';
8386
} else {
8487
(uiSchema as GroupLayout).label = this.control.label;

0 commit comments

Comments
 (0)