tajo / react-range

🎚️Range input with a slider. Accessible. Bring your own styles and markup.
https://react-range.pages.dev
MIT License
859 stars 97 forks source link

Mouseup event not tirggered outside of component #123

Closed iamterryclark closed 3 months ago

iamterryclark commented 3 years ago

Hi there,

Not sure if this is similar to issue #120 and issue #117.

I have implemented my own mouseup and down within the rendertrack which I pass the event over for the mouse down props.onMouseDown(e);. However, it seems I am unable to do the same for mouseup.

When dragging the slider and I mouseup outside of the component the event does not get triggered and so the mouse events get stolen for future mouse clicks.

Is there a work around for this you can think of?

Edit:

I also tried to implement mouseup here

export interface ITrackProps {
    style: React.CSSProperties;
    ref: React.RefObject<any>;
    onMouseDown: (e: React.MouseEvent) => void;
    onMouseUp: (e: React.MouseEvent) => void;
    onTouchStart: (e: React.TouchEvent) => void;
}
tajo commented 3 months ago

repro with https://stackblitz.com/edit/react-range-edit?file=src%2FApp.tsx?