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

@ -201,6 +201,7 @@ export default {
styleElement: null,
data() {
return {
id: this.$attrs.id,
d_selection: this.selection,
focused: {
sourceList: false,
@ -210,6 +211,9 @@ export default {
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
},
selection(newValue) {
this.d_selection = newValue;
}
@ -225,6 +229,8 @@ export default {
this.destroyStyle();
},
mounted() {
this.id = this.id || UniqueComponentId();
if (this.responsive) {
this.createStyle();
}
@ -797,10 +803,10 @@ export default {
},
computed: {
idSource() {
return this.$attrs.id || UniqueComponentId();
return `${this.id}_source`;
},
idTarget() {
return this.$attrs.id || UniqueComponentId();
return `${this.id}_target`;
},
focusedOptionId() {
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;