Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

onClick stops working once an images loop #66

Description

@eirikrsuzuki
      <TinySlider onClick={showSlideInfo} settings={settings}>
        {sideImages.map((image: any, index: number) => {
          return (
            <div className="relative w-[140px]" key={`sideimage-${index}`}>
              <img
                id={`slideid-${image.index}`}
                src={image.src}
                className="cursor-pointer w-full opacity-50 hover:opacity-100 transition-all"
                style={{
                  transitionProperty: 'all',
                  transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
                  transitionDuration: '400ms',
                }}
                onClick={() => openLightbox(image.src)}
              />
            </div>
          )
        })}
      </TinySlider>
    </div>```

openLightbox() works the first time the slider goes through the images, but after the loop it the onClick property seems to disappear entirely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions