From 14fd05f3938bb448b3c0a869311706d4b2e7ba39 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Fri, 26 Feb 2021 15:02:23 +0300 Subject: [PATCH] Fixed #1026 - [BUG] PrimeVue 3.3.0: Dropdown's select item logic is broken --- src/components/dropdown/Dropdown.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index 8aa433391..0e634c591 100755 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -136,9 +136,6 @@ export default { this.itemsWrapper = null; this.overlay = null; }, - updated() { - this.scrollValueInView(); - }, methods: { getOptionLabel(option) { return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; @@ -391,6 +388,7 @@ export default { }, onOverlayEnter() { this.overlay.style.zIndex = String(DomHandler.generateZIndex()); + this.scrollValueInView(); this.appendContainer(); this.alignOverlay(); this.bindOutsideClickListener(); @@ -583,7 +581,7 @@ export default { if (this.overlay) { let selectedItem = DomHandler.findSingle(this.overlay, 'li.p-highlight'); if (selectedItem) { - DomHandler.scrollInView(this.itemsWrapper, DomHandler.findSingle(this.overlay, 'li.p-highlight')); + this.itemsWrapper.scrollTop = selectedItem.offsetTop; } } }