Fixed #3558 - Unique values created in components are set incorrectly.

This commit is contained in:
mertsincan 2023-01-19 04:01:03 +00:00
parent 86a34cde87
commit 2da56f7ed9
18 changed files with 120 additions and 52 deletions

View file

@ -84,12 +84,18 @@ export default {
},
data() {
return {
id: this.$attrs.id,
overlayVisible: false,
focused: false,
focusedOptionIndex: -1,
selectedOptionIndex: -1
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
},
target: null,
outsideClickListener: null,
scrollHandler: null,
@ -97,6 +103,8 @@ export default {
container: null,
list: null,
mounted() {
this.id = this.id || UniqueComponentId();
if (!this.popup) {
this.bindResizeListener();
this.bindOutsideClickListener();
@ -389,9 +397,6 @@ export default {
}
];
},
id() {
return this.$attrs.id || UniqueComponentId();
},
focusedOptionId() {
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
}