Skip to content

[slider] component cannot be dragged if parent element uses e.preventDefault() #35887

@eliassotodo

Description

@eliassotodo

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/hardcore-silence-ywxfbo?file=/src/App.js

Steps:

  1. Stop propagation of "mousemove" on the parent of the slider i.e.onMouseMove={(e) => e.stopPropagation()}
  2. Try to drag the thumb of the slider

Current behavior 😯

Slider thumb cannot be dragged.

Expected behavior 🤔

Slider should work no matter if one stop propagation in some parent of the Slider

Context 🔦

The Slider component has a parent way up on the three that needs to prevent propaggation of events. I cannot use the slider :(

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: sliderChanges related to the slider.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions