question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong active dots calculation

See original GitHub issue

Issuehunt badges

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a carousel with 5 items
  2. Pass following props:
<Carousel
  ...
  dots
  slidesPerPage={2}
  slidesPerScroll={2}
>
  1. Keep changing active slides
  2. Notice the order of active dots (it’s repeatable 1, 3, 5, 2, 4)

Expected behavior Probably active dots should be calculated differently for this kind of situation.

Screenshots ezgif com-video-to-gif (1)

Desktop (please complete the following information):

  • OS: [macOS 10.14.6]
  • Browser [Chrome]
  • Version [79.0.3945.88]

IssueHunt Summary

Backers (Total: $0.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Lukasz-pluszczewskicommented, Jan 15, 2020

@piotr-s-brainhub 5: [5, 1] instead of 5: [5, empty-space] makes sense if infinite is on. But the problem @pierzchalatomasz described is that when I have slidesPerPage={2}, slidesPerScroll={2} and 6 “slides”, the actual number of pages is 3, so some users expect to have 3 dots. The issue here is that we always use the slide index and not page index. The reason for this is that we can have slidesPerPage={2} but slidesPerScroll={3}. What number of “pages” are there then? Not 3, because after clicking right arrow you end up on “page” 2,5. You can also have slidesPerPage={2} and controlled carousel, and pass the index 1 or 3 to it. You would be on a half page then.

I would leave the indexing as is, and the users just need to implement dots by themselves to have the behaviour @pierzchalatomasz suggested.

1reaction
pierzchalatomaszcommented, Jan 13, 2020

Hi @jamsinclair,

In this situation we have 5 scenes (I mean slides visible at one time) in the following order (where [1, 2] meaning scene with slides 1 and 2 etc.):

  1. [1, 2]
  2. [3, 4]
  3. [5, 1]
  4. [2, 3]
  5. [4, 5]

I would expect that dots are calculated based on the index of scene instead of the first item in a current scene i.e. dots should be activated in the following order: 1 => 2 => 3 => 4 => 5 instead of 1 => 3 => 5 => 2 => 4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrongly activated dot on line chart with multiple data ...
I debugged the source code and saw that activeDot is handled by chart and calculate index of active xAxis tick (think like column...
Read more >
Calculator - APE
The App “APE Calculator” is for solving equations from non-linear optics. With over 10,000 downloads, it is one of the most frequently used ......
Read more >
OTIF, DIFOT, Fill Rate: KPI Service Calculation & Formulas
DIFOT = DIF x DOQ x DOT​​ Keep in mind that the most important calculation is related to the quantities delivered (DIF). You...
Read more >
[3.02] DoT damage calculation issues - Pillars of Eternity
The total damage of the DOT is reduced by the DR and the result is equally distributed over the entire duration of the...
Read more >
2009 Edition Chapter 3B. Pavement and Curb Markings
... transition taper length should be computed by the formula L = WS. ... proceeding in the wrong direction may be red (see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found