diff --git a/src/back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.ts b/src/back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.ts index fce7fdb..59f6270 100644 --- a/src/back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.ts +++ b/src/back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.ts @@ -83,11 +83,19 @@ export default class HorizontalScroller extends Controller { 1 - this.findNextNotFullyVisible([...this.visibility].reverse()) ); - this.elementTargets[index].scrollIntoView({ behavior: "smooth" }); + this.elementTargets[index].scrollIntoView({ + behavior: "smooth", + block: "nearest", + inline: "center", + }); } scrollRight() { const index = this.findNextNotFullyVisible(this.visibility); - this.elementTargets[index].scrollIntoView({ behavior: "smooth" }); + this.elementTargets[index].scrollIntoView({ + behavior: "smooth", + block: "nearest", + inline: "center", + }); } }