Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

fix(combobox-multi-select): fix ref not existing error #1084

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,8 @@ export default {
watch: {
selectedItems: {
deep: true,
immediate: true,
handler: async function () {
await this.$nextTick();
this.setInputPadding();
this.setChipsTopPosition();
this.setInputMinWidth();
this.checkMaxSelected();
this.initSelectedItems();
},
},

Expand All @@ -429,8 +424,6 @@ export default {
this.setInputPadding();
this.setChipsTopPosition();
},

immediate: true,
},
},

Expand All @@ -441,13 +434,23 @@ export default {
this.setInputPadding();
});
this.resizeWindowObserver.observe(document.body);

this.initSelectedItems();
},

beforeUnmount () {
this.resizeWindowObserver?.unobserve(document.body);
},

methods: {
async initSelectedItems () {
await this.$nextTick();
this.setInputPadding();
this.setChipsTopPosition();
this.setInputMinWidth();
this.checkMaxSelected();
},

onChipRemove (item) {
this.$emit('remove', item);
this.$refs.input?.focus();
Expand Down