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

When using fade, slides are still stacked, meaning links etc on lower slides are inaccessible

Open ghost opened this issue 6 years ago • 7 comments

When using the fade options, slides are not actually set to display: none their visibility and opacity is just altered. This means that which ever slide is last in the list is the one which is actually clickable. For example, create a slideshow of images with links - https://codesandbox.io/s/7j6j388070 - No matter which slide is shown, you can only ever get to the link on the last slide.

Once a slide isn't visible it needs it's display property changing so it doesn't affect the other slides and sit on top of them.

ghost avatar Apr 04 '18 17:04 ghost

I had the same issue just yesterday. I made this component as a workaround:

const ClickableEnvironmentInCarousel = ({ children }) => {
  return (
    <WhateverBoxDivThingYouUse
      position="relative"
      zIndex="1"
    >
      {children}
    </WhateverBoxDivThingYouUse>
  );
};

By wrapping that around whatever elements needed to be clickable, they would "elevated" when that carousel slide was active and thus clickable. Bit hacky, but it works until a proper fix gets implemented.

(Of course, you'll need some sort of implementation to pass the appropriate CSS position and z-index for the container div that does the elevating.)

VinceSJ avatar Apr 04 '18 22:04 VinceSJ

Thanks for that. I decided it was easier just to do the following which seems to work :)

.slick-slide.slick-active { z-index: 999; }

ghost avatar Apr 05 '18 06:04 ghost

Alternate CSS workaround:

.slick-slide { pointer-events: none; }
.slick-active { pointer-events: auto; }

Though I'd like to see this fixed in the core code.

chicgeek avatar Apr 26 '18 09:04 chicgeek

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.

stale[bot] avatar Apr 21 '19 10:04 stale[bot]

I have the same problem and I think the @chicgeek solution is the right one to avoid conflicts with other elements z-index.

marioelo avatar Apr 24 '19 20:04 marioelo

This is still happening but thanks chicgeek

lamellama avatar Jun 25 '21 12:06 lamellama

This issue has reappeared after being fixed previously: https://github.com/akiran/react-slick/issues/852.

elkelk avatar Mar 23 '22 15:03 elkelk