fix option remove

This commit is contained in:
Pete Matsyburka
2024-03-17 19:40:30 +02:00
parent 95899336b8
commit 3db7d47746
+6 -1
View File
@@ -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()
},