Skip to content

A platform for community discussion. Free, open, simple.

DEV: more reliable image-carousel test (#37176)

Joffrey JAFFEUXb4f376e81482
diff --git a/frontend/discourse/app/components/image-carousel.gjs b/frontend/discourse/app/components/image-carousel.gjs
index 1c4d1fa644d..42b780de98c 100644
--- a/frontend/discourse/app/components/image-carousel.gjs
+++ b/frontend/discourse/app/components/image-carousel.gjs
@@ -63,13 +63,13 @@ export default class ImageCarousel extends Component {
element.addEventListener("scroll", onScroll, { passive: true });
- if (supportsScrollEnd) {
+ if (supportsScrollEnd && !isTesting()) {
element.addEventListener("scrollend", updateIndex);
}
return () => {
element.removeEventListener("scroll", onScroll);
- if (supportsScrollEnd) {
+ if (supportsScrollEnd && !isTesting()) {
element.removeEventListener("scrollend", updateIndex);
}
clearTimeout(scrollStopTimer);