mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-26 08:31:04 +00:00
Unbork test relying on old keystroke behavior
Previously it would both send the keydown *and then* the action, now it send the action, and then because there was an action, does not send the keydown Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
09b32e6a0e
commit
bf8f3e3d68
1 changed files with 5 additions and 1 deletions
|
@ -307,7 +307,10 @@ mod test {
|
|||
div().id("testview").child(
|
||||
div()
|
||||
.key_context("parent")
|
||||
.on_key_down(cx.listener(|this, _, _| this.saw_key_down = true))
|
||||
.on_key_down(cx.listener(|this, _, cx| {
|
||||
cx.stop_propagation();
|
||||
this.saw_key_down = true
|
||||
}))
|
||||
.on_action(
|
||||
cx.listener(|this: &mut TestView, _: &TestAction, _| {
|
||||
this.saw_action = true
|
||||
|
@ -343,6 +346,7 @@ mod test {
|
|||
.update(cx, |test_view, cx| cx.focus(&test_view.focus_handle))
|
||||
.unwrap();
|
||||
|
||||
cx.dispatch_keystroke(*window, Keystroke::parse("a").unwrap(), false);
|
||||
cx.dispatch_keystroke(*window, Keystroke::parse("ctrl-g").unwrap(), false);
|
||||
|
||||
window
|
||||
|
|
Loading…
Reference in a new issue