Fixed #1735 - TreeSelect should automatically scroll to show the selected option
parent
d849dea6f8
commit
089f315ced
|
@ -218,6 +218,7 @@ export default {
|
||||||
this.bindOutsideClickListener();
|
this.bindOutsideClickListener();
|
||||||
this.bindScrollListener();
|
this.bindScrollListener();
|
||||||
this.bindResizeListener();
|
this.bindResizeListener();
|
||||||
|
this.scrollValueInView();
|
||||||
this.$emit('show');
|
this.$emit('show');
|
||||||
},
|
},
|
||||||
onOverlayLeave() {
|
onOverlayLeave() {
|
||||||
|
@ -354,6 +355,14 @@ export default {
|
||||||
this.expandedKeys[key] = true;
|
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: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue