From f829d0cd4f7b2da4bc4e449e37e11d9adea063e6 Mon Sep 17 00:00:00 2001 From: Michael Liendo Date: Mon, 23 Sep 2024 21:50:18 -0400 Subject: [PATCH] chore: handle required attribute for the textfield and use in the publisher component --- crates/web/src/components/publisher/mod.rs | 2 +- crates/web/src/components/text_field.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/web/src/components/publisher/mod.rs b/crates/web/src/components/publisher/mod.rs index f77a239..8f3d9ca 100644 --- a/crates/web/src/components/publisher/mod.rs +++ b/crates/web/src/components/publisher/mod.rs @@ -51,7 +51,7 @@ pub fn Publisher() -> impl IntoView { send_post_action.dispatch((title, content)); }>
- +
diff --git a/crates/web/src/components/text_field.rs b/crates/web/src/components/text_field.rs index a86ee27..86c2f10 100644 --- a/crates/web/src/components/text_field.rs +++ b/crates/web/src/components/text_field.rs @@ -40,6 +40,7 @@ pub fn TextField( #[prop(optional, into)] class: TextProp, #[prop(optional, into)] variant: MaybeProp, #[prop(optional, into)] r#type: TextFieldType, + #[prop(optional, into)] required: MaybeProp, #[prop(optional, into)] disabled: MaybeProp, #[prop(optional, into)] full_width: MaybeProp, ) -> impl IntoView { @@ -103,6 +104,7 @@ pub fn TextField( placeholder=placeholder class=class_names disabled=disabled + required=required on:change=handle_change on:input=handle_input />