diff --git a/packages/primevue/src/treeselect/TreeSelect.vue b/packages/primevue/src/treeselect/TreeSelect.vue index d3eb88559..f6af50dbf 100644 --- a/packages/primevue/src/treeselect/TreeSelect.vue +++ b/packages/primevue/src/treeselect/TreeSelect.vue @@ -132,7 +132,7 @@ import { absolutePosition, addStyle, find, findSingle, focus, getFirstFocusableElement, getFocusableElements, getLastFocusableElement, getOuterWidth, isTouchDevice, relativePosition } from '@primeuix/utils/dom'; import { isEmpty, isNotEmpty } from '@primeuix/utils/object'; import { ZIndex } from '@primeuix/utils/zindex'; -import { ConnectedOverlayScrollHandler, UniqueComponentId } from '@primevue/core/utils'; +import { ConnectedOverlayScrollHandler } from '@primevue/core/utils'; import ChevronDownIcon from '@primevue/icons/chevrondown'; import TimesIcon from '@primevue/icons/times'; import Chip from 'primevue/chip'; @@ -152,16 +152,12 @@ export default { }, data() { return { - id: this.$attrs.id, focused: false, overlayVisible: false, d_expandedKeys: this.expandedKeys || {} }; }, watch: { - '$attrs.id': function (newValue) { - this.id = newValue || UniqueComponentId(); - }, modelValue: { handler: function () { if (!this.selfChange) { @@ -200,7 +196,6 @@ export default { } }, mounted() { - this.id = this.id || UniqueComponentId(); this.updateTreeState(); }, methods: { @@ -560,7 +555,7 @@ export default { return !this.options || this.options.length === 0; }, listId() { - return this.id + '_list'; + return this.$id + '_list'; }, hasFluid() { return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;