FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3k stars 596 forks source link

Set draggable=false on only children of the SliderList, not the whole document #972

Closed majgaard closed 1 year ago

majgaard commented 1 year ago

Description

Nuka Carousel currently applies its .slider-list img query selector to the entire document, rather than the narrower scope it ought to impact. In case of conflicting class names, Nuka Carousel may impact elements beyond its own scope.

Another less common reason:

I intend to use Nuka Carousel inside a React portal which portals its content into an <iframe /> element. Because my React code runs on the host window, libraries which access the global window & document end up impacting only the content outside the iframe. The motivation behind portaling into an iframe is to shelter my UI from undue influence from the host page it is embedded on (and shelter the host page from things my code may be doing). If I depend on libraries which access the global window or document, things will break ¯_(ツ)_/¯

Type of Change

How Has This Been Tested?

I ran the whole test suite, and also verified that the draggable=false attribute was being set on the demo carousel images.

Checklist

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nuka-carousel ✅ Ready (Inspect) Visit Preview Sep 22, 2022 at 3:25AM (UTC)
fritz-c commented 1 year ago

This fix is now available in v5.4.0. Thanks!