React-slick: "rtl: true" puts slides out of place

Created on 11 May 2018  路  8Comments  路  Source: akiran/react-slick

Opening new issue since #952 was closed but does not contain a proper solution.

I tried playing with the source and have further narrowed the issue. Didn't succeed in fixing it, but hope the info will help. All applies to rtl: true prop and 'direction=rtl' in the html.

Initial load and first click places first slide off due to incorrect calculation of slidesToOffset here

src/sandbox/react-slick/mixins/trackHelper.js:138

Demo here Initial load should show slides 1, 2 and 3.

stale

All 8 comments

It's not only the initial load, i think any calculation taking place when rtl is set to true are off.
for example afterChange gives a wrong index.

@mcfoton why did you close it?

@sag1v oops. wild clicking. thanks for pointing out.
also agreed, the miscalculation of slidesToOffset affects all other states as well.

also I believe calculations should be fixed here

/react-slick/utils/innerSliderUtils.js:99

spec.currentSlide >= spec.slideCount - spec.slidesToShow

otherwise after we click 'prev' once the 'next' arrow would be disabled
problem is that canGoNext method doesn't seem to receive 'rtl' prop in the 'spec' parameter.

Shame there is no much of activity for issues and PR reviews for this component :/

@sag1v attached PR. maybe it'll help you in the meantime

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

any news about this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

will88 picture will88  路  3Comments

briziel picture briziel  路  3Comments

walker-jiang picture walker-jiang  路  3Comments

artemidas picture artemidas  路  4Comments

enriquelopez-atlas picture enriquelopez-atlas  路  3Comments