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

@ -103,11 +103,20 @@ export default {
},
data() {
return {
id: this.menuId,
currentIndex: -3,
focused: false,
focusedOptionIndex: -1
};
},
watch: {
menuId(newValue) {
this.id = newValue || UniqueComponentId();
}
},
mounted() {
this.id = this.id || UniqueComponentId();
},
methods: {
getItemId(index) {
return `${this.id}_${index}`;
@ -263,9 +272,6 @@ export default {
}
},
computed: {
id() {
return this.menuId || UniqueComponentId();
},
focusedOptionId() {
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
}