echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive.

Open Skrypt opened this issue 2 years ago • 33 comments
trafficstars

Version

5.4.1

Link to Minimal Reproduction

No response

Steps to Reproduce

import * as echarts from "echarts";

echarts.init(container);

Current Behavior

[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

image

Expected Behavior

This violation warning should not display.

Environment

- OS: Windows 11
- Browser: 110.0.5481.77
- Framework: Vue 3

Any additional comments?

No response

Skrypt avatar Feb 09 '23 16:02 Skrypt

I found the method of installing default-passive-events on the internet and the warning disappeared. But when I use the scrolling chart of echarts, I will report an error: Unable to preventDefault inside passive event listener invocation

doyao avatar Feb 10 '23 08:02 doyao

Will this bug be fixed soon?

LvChengbin avatar Mar 12 '23 12:03 LvChengbin

Hope to fix it in the next release

clark-tan avatar May 22 '23 12:05 clark-tan

+1

ericrange avatar Jun 07 '23 10:06 ericrange

+1

Thevyn avatar Jul 04 '23 08:07 Thevyn

We need to fix this problem, please.

kanxingyv avatar Jul 09 '23 02:07 kanxingyv

Some components like DataZoom will need to stop the scroll behavior, so it can't be simply set as passive.

plainheart avatar Jul 09 '23 14:07 plainheart

+1, v5.4.2

cj123195 avatar Jul 14 '23 01:07 cj123195

+1, v5.4.3

chainix avatar Jul 23 '23 18:07 chainix

+1 需要修复这个问题

rr13k avatar Aug 31 '23 06:08 rr13k

+1 [email protected] [email protected] 调用echarts.init初始化时 就会出现这个告警

image

yimingbot avatar Sep 08 '23 02:09 yimingbot

请在 init 方法调用mousewheel监听的事件中添加 { passive: true } 选项参数,屏蔽一下这个警告,谢谢

zyt520ham avatar Nov 15 '23 04:11 zyt520ham

添加了 { passive: true } 选项参数 ,没生效 还是报这个警告,你们的解决了吗

History-1024 avatar Nov 30 '23 03:11 History-1024

添加了 { passive: true } 选项参数 ,没生效 还是报这个警告,你们的解决了吗

官方都没有这个 参数,肯定没生效呢。 目前看没有解决,我也遇到同样的警告在init时

AKclown avatar Dec 15 '23 03:12 AKclown

I have the same issue

Dev-Hogan avatar Dec 15 '23 06:12 Dev-Hogan

+1

shifatul-i avatar Dec 23 '23 23:12 shifatul-i

+1

NazarovAsadbek-AX avatar Dec 29 '23 04:12 NazarovAsadbek-AX

建议新版本在相关的处理事件的监听中,显式的声明出 passive 的状态,以屏蔽此警告

xiaoyan13 avatar Mar 04 '24 05:03 xiaoyan13

Any new developments?

YI-- avatar Apr 10 '24 06:04 YI--

v5.5.0 also get warnning

zhisonggang avatar May 24 '24 07:05 zhisonggang

Is there any progress on this?

CollectorOfGarbage avatar Jun 11 '24 07:06 CollectorOfGarbage

+1 需要修复这个问题

hukun1993 avatar Jun 28 '24 03:06 hukun1993

I also got this waning. Is there a plan to fix this?

jy03187487 avatar Aug 14 '24 07:08 jy03187487

Also applicable on macOS 14.6.1 with Chrome 127.0.6533.120 and ECharts 5.5.1

funnel20 avatar Sep 15 '24 09:09 funnel20

My package version is like below. and it is still make warning in console. "echarts": "^5.5.1", "echarts-for-react": "^3.0.2",

is there any way to optimize performance in echarts-for-react like "add passive property in echarts-for-react" ?

BradleyyKim avatar Oct 15 '24 03:10 BradleyyKim

+1

francoisburdy avatar Oct 29 '24 13:10 francoisburdy

+1 Same behaviour in "echarts": "^5.5.1", for angular, with dataZoom, so it cannot be turned to passive. Would like to have a solution for this

gemma1987 avatar Nov 05 '24 09:11 gemma1987

Some components like DataZoom will need to stop the scroll behavior, so it can't be simply set as passive.

Since the bug has been taken off it has been a long time, is there going to be a solution any time soon? As you said, you cannot just set it to passive, since DataZoom is there...

gemma1987 avatar Nov 05 '24 09:11 gemma1987

+1 , "echarts": "^5.5.1"

Johnwjl avatar Nov 06 '24 12:11 Johnwjl

Hello everyone, I added this package to my react project with echarts, did the import and it solved the warnings problem apparently.

Step 1: npm install default-passive-events --save-dev

Step 2: import 'default-passive-events'

https://www.prestashop.com/forums/topic/901204-solved-uses-passive-event-listeners-to-improve-scrolling-performance-ps1742/

Package: https://www.npmjs.com/package/default-passive-events

madpixelchile avatar Nov 15 '24 13:11 madpixelchile