diff --git a/src/components/editable_cell.rs b/src/components/editable_cell.rs index 04592cc..45e75e0 100644 --- a/src/components/editable_cell.rs +++ b/src/components/editable_cell.rs @@ -9,6 +9,8 @@ pub fn EditableCell( key: Arc, focused_cell: ReadSignal>, set_focused_cell: WriteSignal>, + on_focus: Option>, + on_blur: Option>, ) -> impl IntoView { let input_ref = create_node_ref::(); let (local_value, set_local_value) = create_signal(value.clone()); @@ -33,6 +35,9 @@ pub fn EditableCell( move |_| { log!("Focus gained for key: {}", key); set_focused_cell.set(Some(key.to_string())); + if let Some(on_focus) = &on_focus { + on_focus.call(()); + } } }; @@ -40,6 +45,9 @@ pub fn EditableCell( log!("Focus lost"); set_focused_cell.set(None); commit_input(); + if let Some(on_blur) = &on_blur { + on_blur.call(()); + } }; // Update input field value when focused cell changes