Refactor GoToLine to use cx.observe_new_views()

This commit is contained in:
Conrad Irwin 2023-11-08 16:23:05 -07:00
parent cbdd4aca89
commit 1b9f76c01d
11 changed files with 136 additions and 65 deletions

View file

@ -414,10 +414,14 @@ pub trait ElementInteractivity<V: 'static>: 'static {
Box::new(move |_, key_down, context, phase, cx| {
if phase == DispatchPhase::Bubble {
let key_down = key_down.downcast_ref::<KeyDownEvent>().unwrap();
dbg!(key_down);
if let KeyMatch::Some(action) =
cx.match_keystroke(&global_id, &key_down.keystroke, context)
{
dbg!(&action);
return Some(action);
} else {
dbg!("none");
}
}