6f647 unable to add a block (#411)

* fix store content bug

* fix: form field indexing bug on working form store

* fix column width on  form fied

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-05-22 08:38:22 +01:00 committed by GitHub
parent 443f4ef7b9
commit 292e32959b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -248,7 +248,7 @@ export default {
this.workingFormStore.openAddFieldSidebar(this.field) this.workingFormStore.openAddFieldSidebar(this.field)
}, },
getFieldWidthClasses(field) { getFieldWidthClasses(field) {
if (!field.width || field.width === 'full') return 'col-span-full w-full' if (!field.width || field.width === 'full') return 'col-span-full'
else if (field.width === '1/2') { else if (field.width === '1/2') {
return 'w-full sm:col-span-6 col-span-full' return 'w-full sm:col-span-6 col-span-full'
} else if (field.width === '1/3') { } else if (field.width === '1/3') {

View File

@ -129,8 +129,8 @@ export const useWorkingFormStore = defineStore("working_form", {
} }
newBlock.help_position = "below_input" newBlock.help_position = "below_input"
if ( if (
this.selectedFieldIndex === null || (this.selectedFieldIndex === null || this.selectedFieldIndex === undefined) &&
this.selectedFieldIndex === undefined (index === null || index === undefined)
) { ) {
const newFields = clonedeep(this.content.properties) const newFields = clonedeep(this.content.properties)
newFields.push(newBlock) newFields.push(newBlock)