Skip to content

Commit 5b33270

Browse files
committed
feat: Fix issue with QStringControlRenderer setup function
The setup function in the QStringControlRenderer component was not handling the value correctly when it was an object. This commit fixes the issue by checking if the value is an object and returning its value property, or returning the value itself if it's not an object.
1 parent 84c05d1 commit 5b33270

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/components/quasar-jsonform/controls/QStringControlRenderer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const QStringControlRenderer = defineComponent({
6666
setup(props: RendererProps<ControlElement>) {
6767
return useQuasarControl(
6868
useJsonFormsControl(props),
69-
(value) => isObject(value) ? value.value : value || undefined
69+
(value) => isObject(value) ? value.value : value || undefined,
7070
)
7171
},
7272
methods: {

src/components/quasar-jsonform/util/composition.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ export const useQuasarControl = <
113113
return props && isPlainObject(props) ? props : {};
114114
};
115115

116+
console.log('input', input.control.value.path, input.control.value.data)
117+
if (typeof input.control.value.data === 'undefined' || input.control.value.data === null && input.control.value.errors) {
118+
console.log('input.data', input.control.value.data)
119+
input.handleChange(input.control.value.path, '')
120+
}
121+
console.log('input.data', input.control.value)
122+
116123
return {
117124
...input,
118125
styles,

0 commit comments

Comments
 (0)