diff --git a/crates/story/src/input_story.rs b/crates/story/src/input_story.rs index 902bbdb3..dea7c767 100644 --- a/crates/story/src/input_story.rs +++ b/crates/story/src/input_story.rs @@ -263,7 +263,12 @@ impl InputStory { ) { match event { NumberInputEvent::Input(input_event) => match input_event { - InputEvent::Change(text) => println!("Change: {}", text), + InputEvent::Change(text) => { + if let Ok(value) = text.parse::() { + self.number_input1_value = value; + } + println!("Change: {}", text); + } InputEvent::PressEnter => println!("PressEnter"), InputEvent::Focus => println!("Focus"), InputEvent::Blur => println!("Blur"), @@ -294,7 +299,12 @@ impl InputStory { ) { match event { NumberInputEvent::Input(input_event) => match input_event { - InputEvent::Change(text) => println!("Change: {}", text), + InputEvent::Change(text) => { + if let Ok(value) = text.parse::() { + self.number_input2_value = value; + } + println!("Change: {}", text); + } InputEvent::PressEnter => println!("PressEnter"), InputEvent::Focus => println!("Focus"), InputEvent::Blur => println!("Blur"),