Fixed #1735 - TreeSelect should automatically scroll to show the selected option
parent
d849dea6f8
commit
089f315ced
|
@ -218,6 +218,7 @@ export default {
|
|||
this.bindOutsideClickListener();
|
||||
this.bindScrollListener();
|
||||
this.bindResizeListener();
|
||||
this.scrollValueInView();
|
||||
this.$emit('show');
|
||||
},
|
||||
onOverlayLeave() {
|
||||
|
@ -354,6 +355,14 @@ export default {
|
|||
this.expandedKeys[key] = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollValueInView() {
|
||||
if (this.overlay) {
|
||||
let selectedItem = DomHandler.findSingle(this.overlay, 'li.p-highlight');
|
||||
if (selectedItem) {
|
||||
selectedItem.scrollIntoView({ block: 'nearest', inline: 'start' });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Reference in New Issue