Skip to content

Non-passive wheel event listener warning when both move.wheel and zoom.wheel are enabled #9542

@green-study

Description

@green-study

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

When using Blockly, a Chrome console warning appears about a non-passive event listener being added to a scroll-blocking wheel event.

Image

This warning seems to occur when both move.wheel and zoom.wheel are enabled in the Blockly.inject options. Functionally, the workspace behaves as expected (mouse wheel scrolls the workspace, and Ctrl + mouse wheel zooms), and there are no noticeable performance issues. However, the warning is consistently logged, and I’m concerned about potential future implications.

I’d like to confirm whether this behavior is expected and whether there is a recommended way to avoid this warning.

Reproduction steps

  1. Use Blockly v12
  2. Inject a Blockly workspace with both move.wheel and zoom.wheel enabled:
Blockly.inject(blocklyDiv, {
  move: {
    scrollbars: true,
    drag: true,
    wheel: true,
  },
  zoom: {
    wheel: true,
  },
});
  1. Open Chrome DevTools and check the console.
  2. Scroll the mouse wheel over the workspace or use Ctrl + mouse wheel to zoom.
  3. Observe the non-passive event listener warning in the console.

Priority

Low

  • There is no functional or performance issue observed.
  • This is mainly a console warning and a potential future concern rather than a blocking bug.

Stack trace

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

L @ blockly-IxHXmmBh.js:1
createDom @ blockly-IxHXmmBh.js:661
init @ blockly-IxHXmmBh.js:657
init @ blockly-IxHXmmBh.js:757
...

Screenshots

Image

Browsers

Chrome desktop

Metadata

Metadata

Assignees

Labels

issue: bugDescribes why the code or behaviour is wrong

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions