Skip to content

Commit

Permalink
fix(ui): no schema form autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Aug 9, 2024
1 parent 09273e0 commit 8809bf4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
21 changes: 11 additions & 10 deletions opal-ui/src/components/SchemaForm.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<template>
<div v-if="schema">

<div v-if="schema.title" class="text-help">{{ schema.title }}</div>
<div v-if="schema.description" class="text-hint q-mb-sm">{{ schema.description }}</div>
<div v-for="item in schema.items" :key="item.key">
<schema-form-item
v-model="data[item.key]"
:field="item"
:disable="disable"
@update:model-value="onUpdate(item.key)" />
</div>
<form autocomplete="off">
<div v-if="schema.title" class="text-help">{{ schema.title }}</div>
<div v-if="schema.description" class="text-hint q-mb-sm">{{ schema.description }}</div>
<div v-for="item in schema.items" :key="item.key">
<schema-form-item
v-model="data[item.key]"
:field="item"
:disable="disable"
@update:model-value="onUpdate(item.key)" />
</div>
</form>
</div>
</template>

Expand Down
6 changes: 4 additions & 2 deletions opal-ui/src/components/SchemaFormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:label="field.title"
:hint="field.description"
type="password"
autocomplete="new-password"
dense
:disable="disable"
class="q-mb-md"
Expand All @@ -43,6 +44,7 @@
v-model="data"
:label="field.title"
:hint="field.description"
autocomplete="off"
dense
:disable="disable"
class="q-mb-md"
Expand Down Expand Up @@ -130,7 +132,7 @@ import FileSelect from 'src/components/files/FileSelect.vue';
import { FileObject, FormObject, SchemaFormField } from 'src/components/models';
interface Props {
modelValue: boolean | number | string | FileObject | FormObject | Array<FormObject> | undefined;
modelValue: string | number | boolean | FileObject | FormObject | Array<FormObject> | undefined;
field: SchemaFormField;
disable?: boolean;
}
Expand All @@ -144,7 +146,7 @@ const data = ref(props.modelValue);
const dataFile = ref<FileObject>();
const dataArray = ref<Array<FormObject>>([]);
onMounted(init);
//onMounted(init);
watch([() => props.modelValue, () => props.field], init);
Expand Down

0 comments on commit 8809bf4

Please sign in to comment.