react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

RTL layout not working.

Open voodooattack opened this issue 11 years ago • 26 comments

I tried to use the right-to-left feature and it's as though the component is ignoring the prop completely. reac-slick rtl bug

voodooattack avatar Jul 21 '15 12:07 voodooattack

@voodooattack Are you using React compents inside the Slider?

vramana avatar Jul 21 '15 12:07 vramana

Just this:

let sliderItems = [0, 1, 2, 3, 4, 5, 6 , 7, 8].map((i) =>
      <div className="image" key={i} slideIndex={i}><img width={218} height={163} src={"assets/images/" + i + ".jpg"} /></div>);

voodooattack avatar Jul 21 '15 12:07 voodooattack

Please dont give any keys or slideIndex Slider will handle that automatically for you.

vramana avatar Jul 21 '15 12:07 vramana

I just removed them and no change. It still doesn't work.

I originally added them to prevent another bug that output 'Missing Key' all over the console.

voodooattack avatar Jul 21 '15 12:07 voodooattack

Can you show your the entire Slider component with settings?

vramana avatar Jul 21 '15 13:07 vramana

            <Segment fluid slider>
              <Header tagName="h3" ui header>Popular Places Near You</Header>
              <Slider dots infinite speed={500} slidesToShow={4} slidesToScroll={1} centerMode adaptiveHeight rtl={rtl} >
                {sliderItems}
              </Slider>
            </Segment>

voodooattack avatar Jul 21 '15 13:07 voodooattack

Does the Slider work with out any props properly?

vramana avatar Jul 21 '15 13:07 vramana

Only when the html DIR attribute is set to LTR.

voodooattack avatar Jul 21 '15 13:07 voodooattack

Actually Slider doesn't check for dir attribute, It just checks the for rtl prop in the slider.

vramana avatar Jul 21 '15 13:07 vramana

I understand, but the RTL attribute apparently breaks it. I just tried specifying the "rtl" prop only and it still doesn't work.

voodooattack avatar Jul 21 '15 13:07 voodooattack

Do you have react dev tools chrome extension? If not install it and can you open up the Slider component tree and send the screenshot?

vramana avatar Jul 21 '15 13:07 vramana

react-slick bug 2

voodooattack avatar Jul 21 '15 13:07 voodooattack

Sorry, I want to see the InnerSlider tree to see the slides order.

vramana avatar Jul 21 '15 13:07 vramana

react-slick bug 3

voodooattack avatar Jul 21 '15 13:07 voodooattack

I have checked examples in docs. rtl is not working with images only. It seems there is issue with Slider is applying wrong styles specifically left I will look into this.

vramana avatar Jul 21 '15 14:07 vramana

@vramana I'm having issues with rtl too. it only shows first slide and if I move to next slides, the div with slick-track class moves to left instead of moving to right so the div with slick-list class goes empty and nothing is visible at all (except next and previous buttons) look at this:

screenshot 2015-11-30 20 01 14

the first argument of translate3d transition is negative, by changing return targetLeft; to return -targetLeft; in line 119 of trackHelper.js the issue is fixed in my case.

There are other issues with rtl: true like not showing first item at all when you set slidesToShow to some n greater than 1 when the total items are less than n and broken drag too.

sassanh avatar Nov 30 '15 16:11 sassanh

Are there any updates or workarounds on this old issue? Thanks!

icetronics avatar Jan 11 '17 20:01 icetronics

I could not get react-slick working with rtl dir, the items are moving in the opposite direction when swiping or dragging.

icetronics avatar Jan 11 '17 20:01 icetronics

I have the same issue, any updates or workaround? Thanks:)

JosefJurca avatar Feb 06 '17 17:02 JosefJurca

I am also still seeing this issue with the newest update. The arrows appear to click and operate, but the actual slider isn't moving at all.

jakeaaron avatar Mar 08 '17 16:03 jakeaaron