fix(Tabs): incorrect scrollspy position while inside a scroller
This commit is contained in:
+7
-5
@@ -300,12 +300,14 @@ export default createComponent({
|
||||
|
||||
scrollToCurrentContent() {
|
||||
if (this.scrollspy) {
|
||||
this.clickedScroll = true;
|
||||
const instance = this.children[this.currentIndex];
|
||||
const el = instance && instance.$el;
|
||||
const target = this.children[this.currentIndex];
|
||||
const el = target?.$el;
|
||||
|
||||
if (el) {
|
||||
const to = Math.ceil(getElementTop(el)) - this.scrollOffset;
|
||||
scrollTopTo(to, +this.duration, () => {
|
||||
const to = getElementTop(el, this.scroller) - this.scrollOffset;
|
||||
|
||||
this.clickedScroll = true;
|
||||
scrollTopTo(this.scroller, to, +this.duration, () => {
|
||||
this.clickedScroll = false;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user