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

CSS breaks when rendering components with array.map() #66

Open
2 tasks done
alphanoobie opened this issue Mar 23, 2023 · 2 comments
Open
2 tasks done

CSS breaks when rendering components with array.map() #66

alphanoobie opened this issue Mar 23, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@alphanoobie
Copy link

alphanoobie commented Mar 23, 2023

Checks

Version

0.7.12

Description

When I try to render using array.map() the css of the component breaks.

This is the result with following code:

<Splide
          hasTrack={false}
          options={{
            pagination: false,
            rewind: true,
          }}
        >
          <SplideTrack>
            <SplideSlide>
              <CompanyCard />
            </SplideSlide>
            <SplideSlide>
              <CompanyCard />
            </SplideSlide>
            <SplideSlide>
              <CompanyCard />
            </SplideSlide>
            <SplideSlide>
              <CompanyCard />
            </SplideSlide>
            <SplideSlide>
              <CompanyCard />
            </SplideSlide>
          </SplideTrack>

          <div className="splide__arrows">
            <button className="splide__arrow splide__arrow--prev bg-transparent">
              <img
                src="assets/landing3/left-arrow.svg"
                alt="left button"
                className="hover:scale-125 transition duration-500"
              />
            </button>

            <button className="splide__arrow splide__arrow--next bg-transparent">
              <img
                src="assets/landing3/right-arrow.svg"
                alt="right button"
                className="hover:scale-125 transition duration-500"
              />
            </button>
          </div>
        </Splide>

image

And this is what happens when the code looks like this

<Splide
          hasTrack={false}
          options={{
            pagination: false,
            rewind: true,
          }}
        >
          <SplideTrack>
            {companyData.map(()=>{
              return(
                <SplideSlide>
                  <CompanyCard/>
                </SplideSlide>
              )
            })}
          </SplideTrack>

          <div className="splide__arrows">
            <button className="splide__arrow splide__arrow--prev bg-transparent">
              <img
                src="assets/landing3/left-arrow.svg"
                alt="left button"
                className="hover:scale-125 transition duration-500"
              />
            </button>

            <button className="splide__arrow splide__arrow--next bg-transparent">
              <img
                src="assets/landing3/right-arrow.svg"
                alt="right button"
                className="hover:scale-125 transition duration-500"
              />
            </button>
          </div>
        </Splide>

image
The above screenshot is taken at 25% zoom level.

Reproduction Link

No response

Steps to Reproduce

1.create a carousel with arrap.map()

Expected Behaviour

Component rendered should look the same in both scenarios mentioned above

@alphanoobie alphanoobie added the bug Something isn't working label Mar 23, 2023
@DanielRuf
Copy link

We are seeing something similar, but it only breaks "sometimes". Not yet sure why.

@DanielRuf
Copy link

It seems this is not our issue. We have another issue with the breakpoints not firing on navigation change.

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

No branches or pull requests

2 participants