diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index fa7863da..56fb7578 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -1017,20 +1017,17 @@ impl Update { Status::Active }; + let key_press = KeyPress { + key, + modifiers, + text, + status, + }; + if let Some(key_binding) = key_binding { - key_binding(KeyPress { - key, - modifiers, - text, - status, - }) + key_binding(key_press) } else { - Binding::from_key_press(KeyPress { - key, - modifiers, - text, - status, - }) + Binding::from_key_press(key_press) } .map(Self::Binding) }