@@ -13,11 +13,12 @@ const { generateId } = useFormKitSection()
1313
1414const formSchema = ref (editorSchema )
1515const formData = ref (null )
16+ const lastSelection = ref (' showBasic' )
1617
1718function enhanceValuesForInputList(values : any []): any [] {
18- const result = []
19+ const result: any [] = []
1920 values .forEach ((value ) => {
20- result .push ({ ... value , editableItemId: generateId (), selectButton: ' showBasic ' })
21+ result .push ({ ... value , editableItemId: generateId (), selectButton: lastSelection . value })
2122 })
2223 return result
2324}
@@ -31,7 +32,7 @@ function actionDelete(schema: any) {
3132function actionEdit(schema : any ) {
3233 const data = schemaToEditorData ({ ... schema })
3334 addListGroupFunctions (data )
34- formData .value = data
35+ formData .value = { ... data , selectButton: lastSelection . value }
3536}
3637
3738function actionInsert(schema : any ) {
@@ -50,6 +51,7 @@ function actionUpdateInputs() {
5051 const schema = formInputList .value .find (input => input .editableItemId === formData .value .editableItemId )
5152 const index = formInputList .value .indexOf (schema )
5253 formInputList .value .splice (index , 1 , editorDataToSchema (formData .value ))
54+ lastSelection .value = formData .value ? formData .value .selectButton : ' showBasic'
5355 formData .value = null
5456}
5557
0 commit comments