Browse Source

fix: update options array on remove

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6972/head
mertmit 10 months ago
parent
commit
4f19b030b9
  1. 19
      packages/nc-gui/components/smartsheet/column/SelectOptions.vue

19
packages/nc-gui/components/smartsheet/column/SelectOptions.vue

@ -172,7 +172,17 @@ const syncOptions = () => {
}
const removeRenderedOption = (index: number) => {
renderedOptions.value[index].status = 'remove'
const renderedOption = renderedOptions.value[index]
const option = options.value[loadedOptionAnchor.value + index]
renderedOption.status = 'remove'
option.status = 'remove'
renderedOption.status = 'remove'
if (option) {
option.status = 'remove'
}
syncOptions()
const optionId = renderedOptions.value[index]?.id
@ -193,7 +203,12 @@ const optionChanged = (changedId: string) => {
}
const undoRemoveRenderedOption = (index: number) => {
renderedOptions.value[index].status = undefined
const renderedOption = renderedOptions.value[index]
const option = options.value[loadedOptionAnchor.value + index]
renderedOption.status = undefined
option.status = undefined
syncOptions()
const optionId = renderedOptions.value[index]?.id

Loading…
Cancel
Save