diff --git a/assets/style.css b/assets/style.css index 5fee32f..e6da611 100644 --- a/assets/style.css +++ b/assets/style.css @@ -148,4 +148,11 @@ th { .search-icon i.fas.fa-search { margin-left: 5px; +} + +.editable-cell-textarea { + width: 100%; + height: 100px; + resize: vertical; + overflow: auto; } \ No newline at end of file diff --git a/src/components/editable_cell.rs b/src/components/editable_cell.rs index 45e75e0..8d269a7 100644 --- a/src/components/editable_cell.rs +++ b/src/components/editable_cell.rs @@ -11,13 +11,18 @@ pub fn EditableCell( set_focused_cell: WriteSignal>, on_focus: Option>, on_blur: Option>, + input_type: InputType, ) -> impl IntoView { let input_ref = create_node_ref::(); + let textarea_ref = create_node_ref::(); let (local_value, set_local_value) = create_signal(value.clone()); - + let input_type_clone = input_type.clone(); // Handle input event let handle_input = move |e: web_sys::Event| { - let new_value = event_target_value(&e); + let new_value = match input_type_clone { + InputType::Text => event_target_value(&e), + InputType::TextArea => event_target_value(&e), + }; log!("Input event: {}", new_value); set_local_value.set(new_value); }; @@ -62,15 +67,35 @@ pub fn EditableCell( view! {
- + {match input_type { + InputType::Text => view! { + + }.into_view(), + InputType::TextArea => view! { +