Skip to content

[Feat]: Dont cross loop when using scrollTo #1121

Answered by davidjerleke
MickL asked this question in Ideas
Discussion options

You must be logged in to vote

Hi @MickL,

Thank you for your feature request.

I understand that having this built-in would be convenient, but I need to carefully evaluate each request to determine if it should be added, considering factors like bundle size and other implications. This is the first time this feature has been requested, so I would need more traction before considering it for inclusion in the core library. While it’s possible others have thought about it, no one has yet submitted a request. I hope that makes sense.

In the meantime, you can use this snippet:

function scrollToDontCrossLoop(targetIndex: number): void {
  if (!emblaApi) return;
  const { index } = emblaApi.internalEngine();
  const direction = 

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@davidjerleke
Comment options

@MickL
Comment options

@davidjerleke
Comment options

@MickL
Comment options

@davidjerleke
Comment options

Answer selected by davidjerleke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
feature request New feature or request resolved This issue is resolved core This is related to the core package
2 participants