@tagplus/components 2.0.20 → 2.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "email": "bruno@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "2.0.20",
11
+ "version": "2.0.21",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -444,10 +444,13 @@ export default {
444
444
  }
445
445
  })
446
446
  } else if (newValue && Object.keys(oldValue).length) {
447
- const itemApagado = oldValue.filter(x => !newValue?.includes(x))
447
+ let itemApagado = []
448
+ if (Array.isArray(oldValue)) {
449
+ itemApagado = oldValue.filter(x => !newValue?.includes(x))
450
+ }
448
451
 
449
452
  this.selectedLabelsArray.forEach((item, index) => {
450
- if (item.id === itemApagado[0] || item.value === itemApagado[0] || item.ncm === itemApagado[0]) {
453
+ if (item.id === itemApagado[0] || item?.value === itemApagado[0] || item?.ncm === itemApagado[0]) {
451
454
  this.selectedLabelsArray.splice(index, 1)
452
455
  }
453
456
  })
@@ -659,6 +662,7 @@ export default {
659
662
  },
660
663
 
661
664
  handleClose () {
665
+ this.selectedLabelsArray = []
662
666
  this.visible && this.$emit('closeSelect')
663
667
  this.visible = false
664
668
  // Limpa busca quando fecha