1 parent e8ca47e commit 64f7f24Copy full SHA for 64f7f24
1 file changed
crates/yew-hooks/src/hooks/use_start_typing.rs
@@ -8,6 +8,9 @@ use yew::prelude::*;
8
9
use super::use_latest;
10
11
+/// Type alias for key filter function to reduce type complexity
12
+type KeyFilter = Box<dyn Fn(&str) -> bool>;
13
+
14
/// A hook that triggers a callback when the user starts typing on the page
15
/// without an editable element focused.
16
///
@@ -98,7 +101,7 @@ pub struct UseStartTypingOptions {
98
101
pub check_modifiers: bool,
99
102
/// Custom function to determine if a key should trigger the callback.
100
103
/// If not provided, defaults to checking if the key is alphanumeric.
- pub key_filter: Option<Box<dyn Fn(&str) -> bool>>,
104
+ pub key_filter: Option<KeyFilter>,
105
}
106
107
impl Default for UseStartTypingOptions {
0 commit comments