From 55d2c5886f8f0859e3862cd0fa1fd34902d2138f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 24 Jul 2020 19:20:46 +0200 Subject: [PATCH] Introduce `state` method to `TextInput` --- native/src/widget/text_input.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 230fe7dc..8c226d3d 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -163,6 +163,13 @@ impl<'a, Message, Renderer: self::Renderer> TextInput<'a, Message, Renderer> { self.style = style.into(); self } + + /// Returns the current [`State`] of the [`TextInput`]. + /// + /// [`TextInput`]: struct.TextInput.html + pub fn state(&self) -> &State { + self.state + } } impl<'a, Message, Renderer> Widget