diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/text_input.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index c131cc77..9fc09b5d 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -114,14 +114,17 @@ where self.is_secure = true; self } - /// Set's the message that should be produced when a message is pasted into the [`TextInput`]. - pub fn on_paste<OnPaste>(mut self, on_paste: OnPaste) -> Self - where - OnPaste: 'a + Fn(String) -> Message, - { + + /// Sets the message that should be produced when some text is pasted into + /// the [`TextInput`]. + pub fn on_paste( + mut self, + on_paste: impl Fn(String) -> Message + 'a, + ) -> Self { self.on_paste = Some(Box::new(on_paste)); self } + /// Sets the [`Font`] of the [`TextInput`]. /// /// [`Font`]: crate::text::Renderer::Font |