-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
onwheel handler panics at installation with BorrowError on mobile #3523
Comments
Also, the content of |
I tested line by line and it seems that the |
For now, a workaround is to manually register the onwheel handler as shown here . You need an extra |
update: onpointerup also panics at installation if used together with onpointermove |
update: This panic seems to goes away if opt-level is set to either 1 or 'z'. So in most cases, building in release mode would fix the panic. Or as a workaroud, use opt-level='z' in dev profile by adding this to the Cargo.toml: [profile.dev]
opt-level = 'z' |
Problem
onwheel
handler panics at installation when used together with certainonpointermove
callbacks on mobile after a certain amount of pointermove events. Also reproducible ifontouchmove
is used instead ofonpointermove
event.Steps To Reproduce
this handler seems to be the culprit
I have boiled my code down to a minimal producing example, here is the repo.
Screenshots
this is the expected behavior. It works on the PC.
However, it panics on the phone after some events.
IMG_0544.mov
(me when I shake my dot too much that it panics)
You can try move in several times, little by little, or you can move a lot at one go, but eventually it will panic (after a fixed amount of events I think)
Noticeably, in my real project, the panic appears much much quickly. Only after less than half second of touch moving. I assume it maybe has to do with the actual
onwheel
handler.This is reproduced both on an iPhone and an Android phone.
I tried some workarounds, including converting
onpointermove
handler to a manual event listener using web_sys; usingCallback::from
instead of theuse_callback
hook. Nothing worked.Here are the panic messages, there are two of them. And they repeat if you keep moving after it panics:
(debug tips: if you use iPhone, turn on web inspector in the settings, and connect it to a Mac to see the console messages)
Environment:
The text was updated successfully, but these errors were encountered: