From 9e20ccc01aa19ff1696e58ee1ce2654bff9d4e74 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Oct 2023 19:50:44 +0200 Subject: [PATCH] Checkpoint --- crates/gpui3/src/window.rs | 4 ++-- crates/storybook2/src/stories/focus.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/gpui3/src/window.rs b/crates/gpui3/src/window.rs index 0f818bb4f09904a075d2dbef65cc9da4e1ca37e9..5a68e0dfd2a55fe343a57435084e1bd68fa4767a 100644 --- a/crates/gpui3/src/window.rs +++ b/crates/gpui3/src/window.rs @@ -945,7 +945,7 @@ impl<'a, 'w> WindowContext<'a, 'w> { } fn dispatch_action(&mut self, action: Box, listeners: &[(TypeId, AnyKeyListener)]) { - let action_type = action.type_id(); + let action_type = action.as_any().type_id(); for (event_type, listener) in listeners { if action_type == *event_type { listener(action.as_any(), DispatchPhase::Capture, self); @@ -958,7 +958,7 @@ impl<'a, 'w> WindowContext<'a, 'w> { if self.window.propagate { for (event_type, listener) in listeners.iter().rev() { if action_type == *event_type { - listener(action.as_any(), DispatchPhase::Capture, self); + listener(action.as_any(), DispatchPhase::Bubble, self); if !self.window.propagate { break; } diff --git a/crates/storybook2/src/stories/focus.rs b/crates/storybook2/src/stories/focus.rs index 3f75631cdac9b9cbdfa453b7827a1ff9ef30f30b..b10c75c1900df614df9d45d2a56b02d17d4bf932 100644 --- a/crates/storybook2/src/stories/focus.rs +++ b/crates/storybook2/src/stories/focus.rs @@ -69,7 +69,7 @@ impl FocusStory { println!("Action A dispatched on parent during {:?}", phase); }) .on_action(|_, action: &ActionB, phase, cx| { - println!("Action A dispatched on parent during {:?}", phase); + println!("Action B dispatched on parent during {:?}", phase); }) .focusable(&parent) .on_focus(|_, _, _| println!("Parent focused"))