Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
bin: Use textfield state in search widget
Erik Kundt committed 2 years ago
commit 4c7327c320c55e35778a9172cf45ad53233fd9f2
parent ef6e800b89282cfde5218a96c43c46008b8b2079
3 files changed +9 -9
modified bin/commands/inbox/select/ui.rs
@@ -477,11 +477,11 @@ impl<B: Backend> View<State, Action> for Search<B> {
        Self: Sized,
    {
        let input = TextField::new(state, action_tx.clone())
-
            .on_change(|props, action_tx| {
-
                props.downcast_ref::<TextFieldProps>().and_then(|props| {
+
            .on_change(|state, action_tx| {
+
                state.downcast_ref::<TextFieldState>().and_then(|state| {
                    action_tx
                        .send(Action::UpdateSearch {
-
                            value: props.text.clone(),
+
                            value: state.text.clone(),
                        })
                        .ok()
                });
modified bin/commands/issue/select/ui.rs
@@ -502,11 +502,11 @@ impl<B: Backend> View<State, Action> for Search<B> {
        Self: Sized,
    {
        let input = TextField::new(state, action_tx.clone())
-
            .on_change(|props, action_tx| {
-
                props.downcast_ref::<TextFieldProps>().and_then(|props| {
+
            .on_change(|state, action_tx| {
+
                state.downcast_ref::<TextFieldState>().and_then(|state| {
                    action_tx
                        .send(Action::UpdateSearch {
-
                            value: props.text.clone(),
+
                            value: state.text.clone(),
                        })
                        .ok()
                });
modified bin/commands/patch/select/ui.rs
@@ -531,11 +531,11 @@ impl<B: Backend> View<State, Action> for Search<B> {
        Self: Sized,
    {
        let input = TextField::new(state, action_tx.clone())
-
            .on_change(|props, action_tx| {
-
                props.downcast_ref::<TextFieldProps>().and_then(|props| {
+
            .on_change(|state, action_tx| {
+
                state.downcast_ref::<TextFieldState>().and_then(|state| {
                    action_tx
                        .send(Action::UpdateSearch {
-
                            value: props.text.clone(),
+
                            value: state.text.clone(),
                        })
                        .ok()
                });