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

Can't seem to use onwheel event on html #1265

Closed
oOBoomberOo opened this issue May 25, 2020 · 2 comments
Closed

Can't seem to use onwheel event on html #1265

oOBoomberOo opened this issue May 25, 2020 · 2 comments
Labels

Comments

@oOBoomberOo
Copy link
Contributor

Problem
I try to create a callback to WheelEvent like this:

let wheel_event = self.link.callback(|event: web_sys::WheelEvent| {
	// ...
})

And apply it to canvas element like this:

html! {
	<div class="image-editor">
		<canvas ref=self.node()
			onwheel=wheel_event
		/>
	</div>
}

But the compiler would complain back

This does not happen with other event callbacks.
Is this just a mistake or is there another event I can use in place of onwheel?

Environment:

  • Yew: 0.16.2
  • Rust: 1.43.1
  • web-sys: 0.3.39
  • OS: Linux Mint
@jstarry
Copy link
Member

jstarry commented May 26, 2020

Hello @oOBoomberOo! Yew is currently using the deprecated onmousewheel event. This was just fixed on master, this PR updated Yew to use onwheel as expected: #1244

@oOBoomberOo
Copy link
Contributor Author

Ah, I see.

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

No branches or pull requests

2 participants