Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage.on('wheel') not firing? #1875

Open
ajthinking opened this issue Jan 15, 2025 · 0 comments
Open

Stage.on('wheel') not firing? #1875

ajthinking opened this issue Jan 15, 2025 · 0 comments

Comments

@ajthinking
Copy link

Consider:

var width = window.innerWidth;
var height = window.innerHeight;

var stage = new Konva.Stage({
  container: 'container',
  width: width,
  height: height,
  draggable: true,
});

stage.on('wheel', (e) => {
  e.evt.preventDefault();
  console.log("Wheel event directly on stage does not work.");
});

document.getElementById('container').addEventListener('wheel', (e) => {
  console.log('Wheel event on container works');
});

Reproduction: https://codepen.io/ajthinking/pen/ZYzRLpv

Not sure if this is an actual bug or my missunderstanding. Click works directly without going via container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant