@antify/ui 2.5.5 → 2.5.6

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.
@@ -193,7 +193,10 @@ function addTag(tagValue: string | number): void {
193
193
  }
194
194
 
195
195
  if (Array.isArray(_modelValue.value)) {
196
- _modelValue.value.push(tagValue);
196
+ _modelValue.value = [
197
+ ..._modelValue.value,
198
+ tagValue,
199
+ ];
197
200
  } else {
198
201
  _modelValue.value = [
199
202
  tagValue,
@@ -205,13 +208,13 @@ function addTag(tagValue: string | number): void {
205
208
 
206
209
  function removeLastTag() {
207
210
  if (tagInput.value === '' && Array.isArray(_modelValue.value) && _modelValue.value.length > 0) {
208
- _modelValue.value.splice(-1, 1);
211
+ _modelValue.value = _modelValue.value.filter((element) => element !== _modelValue.value?.pop());
209
212
  }
210
213
  }
211
214
 
212
215
  function removeTag(tag: string | number) {
213
216
  if (_modelValue.value && !props.disabled && !props.skeleton && !props.readonly) {
214
- _modelValue.value.splice(_modelValue.value.findIndex((_value) => _value === tag), 1);
217
+ _modelValue.value = _modelValue.value.filter((element) => element !== tag);
215
218
  }
216
219
  }
217
220
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antify/ui",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {