Skip to content

Commit

Permalink
fix option remove
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Mar 17, 2024
1 parent 9589933 commit 3db7d47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/javascript/template_builder/field.vue
Expand Up @@ -711,7 +711,12 @@ export default {
},
removeOption (option) {
this.field.options.splice(this.field.options.indexOf(option), 1)
this.field.areas.splice(this.field.areas.findIndex((a) => a.option_uuid === option.uuid), 1)
const optionIndex = this.field.areas.findIndex((a) => a.option_uuid === option.uuid)
if (optionIndex !== -1) {
this.field.areas.splice(this.field.areas.findIndex((a) => a.option_uuid === option.uuid), 1)
}
this.save()
},
Expand Down

0 comments on commit 3db7d47

Please sign in to comment.