【问题标题】:Can drag underneath a MUI dialog backdrop - why doesn't the modal backdrop stop the event propagation可以在 MUI 对话框背景下拖动 - 为什么模态背景不停止事件传播
【发布时间】:2023-02-04 02:00:55
【问题描述】:

在此转载:https://codesandbox.io/s/serene-blackburn-nrgj0b?file=/src/App.js

通常,当对话框组件打开时,MUI(Material-UI)对话框会停止在背景后面的组件上进行鼠标单击。

但是由于某种原因,react-grid-layout 元素仍然可以在 MUI 对话框下拖动。

我不能为我的生活看到这是为什么?

它可以通过将类 .MuiDialog-root 添加到 <GridLayout react-grid-layout 组件的 draggableCancel 属性来修复 - 但这感觉像是针对我不理解的某些事件传播的错误的解决方法。

我在react-grid-layout github repo 中添加了一个问题:https://github.com/react-grid-layout/react-grid-layout/issues/1800

【问题讨论】:

    标签: reactjs material-ui react-grid-layout


    【解决方案1】:

    React 似乎是一个问题(可能是故意的):

    https://github.com/facebook/react/issues/11387

    【讨论】:

      猜你喜欢
      • 2015-09-04
      • 2019-05-17
      • 2019-08-12
      • 2018-06-01
      • 2017-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多