diff --git a/crates/components/src/input.rs b/crates/components/src/input.rs index 18597eccb..4921613a6 100644 --- a/crates/components/src/input.rs +++ b/crates/components/src/input.rs @@ -117,13 +117,11 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element { let onkeydown = { to_owned![editable, focus_manager]; move |e: Event| { - if focus_manager.is_focused() { - if e.data.key != Key::Enter { - editable.process_event(&EditableEvent::KeyDown(e.data)); - cx.props - .onchange - .call(editable.editor().current().to_string()); - } + if focus_manager.is_focused() && e.data.key != Key::Enter { + editable.process_event(&EditableEvent::KeyDown(e.data)); + cx.props + .onchange + .call(editable.editor().current().to_string()); } } };