Browse Source

Merge pull request #6972 from nocodb/fix/select-remove

fix: use options instead of rendered options
pull/7001/head
Pranav C 1 year ago committed by GitHub
parent
commit
bc2cbbd124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      packages/nc-gui/components/smartsheet/column/SelectOptions.vue

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

@ -168,11 +168,21 @@ const addNewOption = () => {
// }
const syncOptions = () => {
vModel.value.colOptions.options = renderedOptions.value.filter((op) => op.status !== 'remove')
vModel.value.colOptions.options = options.value.filter((op) => op.status !== 'remove')
}
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