Inverted scroll compared to webview
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 203
- Avg merge
- 8h 58m
- Merged PRs (30d)
- 112
Description
The onwheel event delta is inverted in blitz compared to webview. Scrolling forward results in positive delta in blitz, while it is negative in webview.
Platform tested: windows 11
```rust
use dioxus_native::prelude::*;
pub fn main() {
dioxus_native::launch(app);
}
fn app() -> Element {
let mut zoom = use_store(|| 1.0);
let mut delta = use_signal(|| 0.);
let onwheel = move |e: Event| {
let y_delta = e.delta().strip_units().y as f32;
delta.set(y_delta);
let factor = (1.0 - y_delta * 0.001).clamp(0.8, 1.2);
let new_zoom = (zoom() * factor).clamp(0.05, 50.0);
zoom.set(new_zoom);
};
rsx!(
div {
position: "absolute",
top: 0,
left: 0,
width: "100vw",
height: "100vh",
onwheel,
div {
position: "absolute",
top: "50%",
left: "50%",
transform: format!("translate(-50%, -50%) scale({})", zoom()),
"Zoom: {zoom():.2}"
"Delta: {delta():.2}"
}
}
)
}
```
Contributor guide
Research direction
Start by running the provided Rust reproduction on Windows 11 and inspect the onwheel handler's WheelData delta in blitz versus the webview behavior described. Trace where the wheel event delta is produced or translated. Done means forward scrolling reports the same delta direction as the webview while the reproduction's zoom behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100