mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03: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
@ -307,7 +307,10 @@ mod test {
|
|||||||
div().id("testview").child(
|
div().id("testview").child(
|
||||||
div()
|
div()
|
||||||
.key_context("parent")
|
.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(
|
.on_action(
|
||||||
cx.listener(|this: &mut TestView, _: &TestAction, _| {
|
cx.listener(|this: &mut TestView, _: &TestAction, _| {
|
||||||
this.saw_action = true
|
this.saw_action = true
|
||||||
@ -343,6 +346,7 @@ mod test {
|
|||||||
.update(cx, |test_view, cx| cx.focus(&test_view.focus_handle))
|
.update(cx, |test_view, cx| cx.focus(&test_view.focus_handle))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
cx.dispatch_keystroke(*window, Keystroke::parse("a").unwrap(), false);
|
||||||
cx.dispatch_keystroke(*window, Keystroke::parse("ctrl-g").unwrap(), false);
|
cx.dispatch_keystroke(*window, Keystroke::parse("ctrl-g").unwrap(), false);
|
||||||
|
|
||||||
window
|
window
|
||||||
|
Loading…
Reference in New Issue
Block a user