Using <Slider> as a child of a React component that also listens for drag events, when I drag the Slider, the parent component event handlers are triggered. (I think - actually I'm a little out of my depth in terms of how these libraries are handling events and which events are being handled)
This is the most basic usage example of react-beautiful-dnd, with a list of 10 items that can be reordered. Each of these items contains a slider that shows the problem I am experiencing (that the slider's can't be dragged without triggering the dnd drag): https://codesandbox.io/s/recursing-nightingale-issyt?fontsize=14&hidenavigation=1&theme=dark (in the Demo.js file)
When trying to update the slider value by drag, the parent component event handlers are fired (see the demo). Updating the slider value by clicking works fine.
I expected that any event explicitly handled by <Slider> would not then bubble up to parent components. Or, I would like to be able to 'manually' prevent this by using ev.stopPropagation. However, having tried this in the onChange event handler I know that this doesn't work. I assume that the onChange handler is an abstraction over other event handlers that I DON'T have access to?
The bug/behaviour (technically I'm not sure that this can be considered a bug per say) is reproduced in the codesanbox example linked to above.
Steps:
isDragDisabled to true (line 83 of Demo.js), then refresh the pageI have found that disabling the ability to drag on the parent element allows me to then using the Slider. So, my current workaround is registering onMouseEnter and onMouseLeave handlers that sets a property on the parent component to disable / enable drag. But I think this is probably inefficient.. since I imagine that I am rerendering the Draggable component more than I have to (I'm not 100% clear on this).
Just out of interest, I see that there is the same problem when using a slider from react-md library: https://codesandbox.io/s/upbeat-mahavira-87ikz?fontsize=14&hidenavigation=1&theme=dark
Interesting. We had almost the same discussion in #16565. I think that we can move forward with: https://github.com/mui-org/material-ui/issues/16565#issuecomment-510426544
Hi, is anyone still working on this?
I was looking at the discussion in #16565 and the comment you suggested above, do you want to add the event.stopPropagation() or something more inline with the last suggestion there (https://github.com/mui-org/material-ui/issues/16565#issuecomment-544137595)?
@brorlarsnicklas You are free to go. It's interesting to compare the behavior with a native slider. If you could figure out what makes it work correctly in https://codesandbox.io/s/boring-platform-tkel2. It would be awesome.

@oliviertassinari I have been looking at the sandbox example and I'm not sure if this is any new information but, I think that there is some diff between how the slider component handles touch events and mouse events. Changing the slider in the sandbox with a touchscreen makes the slider behave correctly (works with both a computer with touchscreen and a phone). Is there a way to adapt the behavior of the touch event to the mouse event?
Since I'm quite new to this I'm not really sure where to look in the slider code though. Any suggestions?
Here is an example using my phone:

@zachsa The Slider has a touch-action CSS property, hence the behavior you are seeing on mobile. The issue is on desktop.
@zachsa react-beautiful-dnd has a custom logic to handle <input type="range" />. They also describe how they behave in https://github.com/atlassian/react-beautiful-dnd/blob/24a8e6021600920c0b2a28f89d5ffb17538fe96c/docs/guides/how-we-use-dom-events.md. I don't think that there is anything we should change. I'm closing.
Any ugly workaround would be to set <div contentEditable> for react-beautiful-dnd. However, I'm not sure what would be the best workaround. Maybe @alexreardon has some tips.
Most helpful comment
@zachsa The Slider has a
touch-actionCSS property, hence the behavior you are seeing on mobile. The issue is on desktop.