echarts [Bug] How to bind events to dataZoom/visualMap components to prevent bubbling behavior

67up9zun  于 9个月前  发布在  Echarts
关注(0)|答案(2)|浏览(158)

Version

5.4.3

https://codesandbox.io/s/frosty-sunset-ctw59j?file=/src/chart.js

Steps to Reproduce

1、滑动 visualMap 任意滑块手柄,手柄位置未发生变化,且拖动了外层容器

Current Behavior

1、当我在 react-grid-layout 中使用 echarts 时,echarts 的 dataZoom/visualMap 组件滑动事件会冒泡至外层组件,导致dataZoom/visualMap 组件滑动事件不可用,且触发了外层组件的滑动事件。

Expected Behavior

1、期望滑动滑块手柄时,能不触发外层容器的滑动事件
2、visualMap、dataZoom等组件支持绑定事件,这样我可以设置事件禁止冒泡

Environment

  1. - OS:
  2. - Browser:
  3. - Framework:

Any additional comments?

No response

jgzswidk

jgzswidk1#

@webiamcome It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED

BODY

Version

5.4.3

https://codesandbox.io/s/frosty-sunset-ctw59j?file=/src/chart.js

Steps to Reproduce

  1. Slide any slider handle of visualMap, the position of the handle has not changed, and drag the outer container

Current Behavior

  1. When I use echarts in react-grid-layout, the dataZoom/visualMap component sliding event of echarts will bubble to the outer component, resulting in the dataZoom/visualMap component sliding event being unavailable and triggering the sliding event of the outer component.

Expected Behavior

  1. When you expect to slide the slider handle, you can not trigger the sliding event of the outer container
  2. Components such as visualMap and dataZoom support binding events, so that I can set events to prohibit bubbling

Environment

  1. - OS:
  2. - Browser:
  3. - Framework:

Any additional comments?

No response

展开查看全部
8hhllhi2

8hhllhi22#

这个问题最好还是在 ECharts 内部禁止冒泡,欢迎提 PR

相关问题