Previously, when slidesToScroll was set to a value larger than 1 with scrollMode set to "remainder", the dots shown were missing the last one. In the case of fractional slidesToShow values, the index of the last dot was also incorrect.
Example: 2 dots, not the expected 3, shown for 5 slides with slidesToScroll={2}Demo link
This PR fixes both these issues and adds a few unit tests to double-check the function that generates the dot indices.
Type of Change
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
I created unit tests that passed a variety of parameters to the getDotIndexes function to test that it returned indices as expected.
The issue can be reproduced by looking at the dots versus the button behavior with this issue example.
Description
Previously, when
slidesToScroll
was set to a value larger than1
withscrollMode
set to"remainder"
, the dots shown were missing the last one. In the case of fractionalslidesToShow
values, the index of the last dot was also incorrect.slidesToScroll={2}
Demo linkThis PR fixes both these issues and adds a few unit tests to double-check the function that generates the dot indices.
Type of Change
How Has This Been Tested?
I created unit tests that passed a variety of parameters to the
getDotIndexes
function to test that it returned indices as expected.The issue can be reproduced by looking at the dots versus the button behavior with this issue example.