Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollTo with jump doesn't work on iOS #514

Closed
1 task done
Tracked by #321
dlhagstroem opened this issue Jul 5, 2023 · 12 comments · Fixed by #520
Closed
1 task done
Tracked by #321

scrollTo with jump doesn't work on iOS #514

dlhagstroem opened this issue Jul 5, 2023 · 12 comments · Fixed by #520
Labels
bug Something isn't working resolved This issue is resolved

Comments

@dlhagstroem
Copy link

dlhagstroem commented Jul 5, 2023

Bug is related to

  • embla-carousel (core package)

Embla Carousel version

"embla-carousel-react": "v8.0.0-rc06",

Describe the bug

scrollTo with jump param does not always work in iOS 16.3.1 (Chrome, Safari browsers tested)

CodeSandbox

https://codesandbox.io/s/xzgjsj

Steps to reproduce

  1. Go to https://xzgjsj.csb.app/ on an iPhone
  2. Click on thumbnails to switch carousel image
  3. Note that image in carousel (slide) is not always set to the active image

Expected behavior

The carousel should show the correct slide.

Additional context

This seems to happen only when jump parameter is set to true when calling emblaApi.scrollTo function like this:

emblaApi.scrollTo(scrollToIndex, true);

Without jump param, carousel work flawless :)

@dlhagstroem dlhagstroem added the bug Something isn't working label Jul 5, 2023
@davidjerleke
Copy link
Owner

davidjerleke commented Jul 5, 2023

Hi @dlhagstroem,

Thanks for a complete bug report. I will look into this and let you know what I find when I've done so.

Best,
David

@MaxDesignFR
Copy link

MaxDesignFR commented Jul 5, 2023

I'm chiming in: I noticed just recently that Embla fluidity was not so great on my android phone (decent but not great, considering I'm on a pixel 4a which is a good phone), I wonder if will-change:transform on the container could somehow help with this bug (worth a try)?

Anyways, I did do that in my project and the carousel fluidity feels significantly better, nearly perfect (even though it was usable before, it didn't feel completely right). I'm not sure if it's due to the pre-release: if you like @davidjerleke I can give a try without will-change:transform on an earlier version. But right now it seems like a must-have in my project. I won't diverge more, but I figure this is worth trying for this bug.

@dlhagstroem
Copy link
Author

I'm chiming in: I noticed just recently that Embla fluidity was not so great on my android phone (decent but not great, considering I'm on a pixel 4a which is a good phone), I wonder if will-change:transform on the container could somehow help with this bug (worth a try)?

Anyways, I did do that in my project and the carousel fluidity feels significantly better, nearly perfect (even though it was usable before, it didn't feel completely right). I'm not sure if it's due to the pre-release: if you like @davidjerleke I can give a try without will-change:transform on an earlier version. But right now it seems like a must-have in my project. I won't diverge more, but I figure this is worth trying for this bug.

Thanks for your suggestion, we have tried with no luck. The root cause seems to be something else :/

@davidjerleke davidjerleke mentioned this issue Jul 4, 2023
37 tasks
@davidjerleke
Copy link
Owner

Thanks for the help @MaxDesignFR!

@dlhagstroem I can confirm that this is a bug. Try the following CodeSandbox and let me know if it's working as intended:

Best,
David

@davidjerleke davidjerleke added the investigating Issue is being looked into label Jul 5, 2023
@dlhagstroem
Copy link
Author

dlhagstroem commented Jul 6, 2023

Thanks for the help @MaxDesignFR!

@dlhagstroem I can confirm that this is a bug. Try the following CodeSandbox and let me know if it's working as intended:

Best, David

I gave it a good round, trying to reproduce the issue. No success. Now I am curious about the solution :) (and of course the cause)

@davidjerleke davidjerleke added upcoming A feature or bug fix is on its way for this issue and removed investigating Issue is being looked into labels Jul 6, 2023
@dlhagstroem
Copy link
Author

Hi @davidjerleke ,

would it be possible to get a pre release/rc version including this fix?

@davidjerleke
Copy link
Owner

Hi @dlhagstroem,

It’s on its way and will be released with v8.0.0-rc08. But can’t give an exact ETA because I’m maintaining this library in my spare time.

Best,
David

@dlhagstroem
Copy link
Author

Totally understand, thank you for your efforts!

/Dennis

davidjerleke added a commit that referenced this issue Jul 7, 2023
@davidjerleke davidjerleke linked a pull request Jul 7, 2023 that will close this issue
@davidjerleke
Copy link
Owner

@dlhagstroem I just released v8.0.0-rc08 with a bug fix for this. Give it a try and see if it solves the problem.

Best,
David

@davidjerleke davidjerleke added awaiting response Issue is awaiting feedback resolved This issue is resolved and removed upcoming A feature or bug fix is on its way for this issue awaiting response Issue is awaiting feedback labels Jul 7, 2023
@davidjerleke
Copy link
Owner

@dlhagstroem just wanted to let your know that I would recommend you to try the latest version which is v8.0.0-rc11 at the time of writing. v8 releases are still pre-releases (rc) so they often include bug fixes.

I would appreciate if you could let me know if v8.0.0-rc11 solves this problem.

Best,
David

@dlhagstroem
Copy link
Author

dlhagstroem commented Jul 12, 2023

@davidjerleke sorry for not answering. We upgraded to rc10 a couple of days ago and that solved our issue. We just tried 11 and still works :)

Again, thank you so much for your efforts!

@davidjerleke
Copy link
Owner

davidjerleke commented Jul 12, 2023

@dlhagstroem thank you for confirming 👍🏻!

Ha en trevlig semester om du inte redan haft den 🙂.

Allt gott,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants