Drop scroll events if there's been a reset

co-authored-by: Nathan <nathan@zed.dev>
co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Mikayla
2024-01-17 13:57:16 -08:00
co-authored by Nathan Conrad
parent 80852c3e18
commit 6db18e8972
4 changed files with 112 additions and 114 deletions
+2 -1
View File
@@ -643,7 +643,8 @@ impl<'a> VisualTestContext {
/// Simulate an event from the platform, e.g. a SrollWheelEvent
/// Make sure you've called [VisualTestContext::draw] first!
pub fn simulate_event<E: InputEvent>(&mut self, event: E) {
self.update(|cx| cx.dispatch_event(event.to_platform_input()));
self.test_window(self.window)
.simulate_input(event.to_platform_input());
self.background_executor.run_until_parked();
}