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

@erikksuzuki

Description

@erikksuzuki
      <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.

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