Fixed #1026 - [BUG] PrimeVue 3.3.0: Dropdown's select item logic is broken

pull/1047/head
Cagatay Civici 2021-02-26 15:02:23 +03:00
parent 0646ca72eb
commit 14fd05f393
1 changed files with 2 additions and 4 deletions

View File

@ -136,9 +136,6 @@ export default {
this.itemsWrapper = null; this.itemsWrapper = null;
this.overlay = null; this.overlay = null;
}, },
updated() {
this.scrollValueInView();
},
methods: { methods: {
getOptionLabel(option) { getOptionLabel(option) {
return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option; return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option;
@ -391,6 +388,7 @@ export default {
}, },
onOverlayEnter() { onOverlayEnter() {
this.overlay.style.zIndex = String(DomHandler.generateZIndex()); this.overlay.style.zIndex = String(DomHandler.generateZIndex());
this.scrollValueInView();
this.appendContainer(); this.appendContainer();
this.alignOverlay(); this.alignOverlay();
this.bindOutsideClickListener(); this.bindOutsideClickListener();
@ -583,7 +581,7 @@ export default {
if (this.overlay) { if (this.overlay) {
let selectedItem = DomHandler.findSingle(this.overlay, 'li.p-highlight'); let selectedItem = DomHandler.findSingle(this.overlay, 'li.p-highlight');
if (selectedItem) { if (selectedItem) {
DomHandler.scrollInView(this.itemsWrapper, DomHandler.findSingle(this.overlay, 'li.p-highlight')); this.itemsWrapper.scrollTop = selectedItem.offsetTop;
} }
} }
} }