Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/scrolling-carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ export const ScrollingCarousel: FunctionComponent<SliderProps> = ({
const mouseUp = (_: MouseEvent) => {
setIsDown(false);
setShowArrow(showArrows());
slider.current!.classList.remove(styles.sliding);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you remove this line, the element that is targeted for this mouseUp event will ultimately trigger the onClick event and it will cause <a> elements to trigger a navigation while you still sliding. Check this feature if it's what you are trying to solve, and it can be implemented for this component too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the triggerClickOn prop as in carousel component. Could you review this again?

};

const mouseMove = (e: MouseEvent) => {
if (!isDown) return;
e.preventDefault();
slider.current!.classList.add(styles.sliding);
const eventPosition = e.pageX - slider.current!.offsetLeft;
const slide = eventPosition - position.startX;

Expand Down
4 changes: 0 additions & 4 deletions src/styles/slider/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@
.slider > * {
flex: 0 0 auto;
}

.sliding > * {
pointer-events: none;
}
2 changes: 0 additions & 2 deletions src/styles/slider/styles.module.css.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export const sliderBase: string;
export const slider: string;
export const sliding: string;
interface Namespace {
sliderBase: string;
slider: string;
sliding: string;
}
declare const stylesModule: Namespace;
export default stylesModule;