Prevent vertical scrolling when using horizontal scroller
This commit is contained in:
parent
b46ba714c3
commit
19d04ff48b
@ -83,11 +83,19 @@ export default class HorizontalScroller extends Controller {
|
|||||||
1 -
|
1 -
|
||||||
this.findNextNotFullyVisible([...this.visibility].reverse())
|
this.findNextNotFullyVisible([...this.visibility].reverse())
|
||||||
);
|
);
|
||||||
this.elementTargets[index].scrollIntoView({ behavior: "smooth" });
|
this.elementTargets[index].scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
block: "nearest",
|
||||||
|
inline: "center",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollRight() {
|
scrollRight() {
|
||||||
const index = this.findNextNotFullyVisible(this.visibility);
|
const index = this.findNextNotFullyVisible(this.visibility);
|
||||||
this.elementTargets[index].scrollIntoView({ behavior: "smooth" });
|
this.elementTargets[index].scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
block: "nearest",
|
||||||
|
inline: "center",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user