macro_rules! on_gained {
($($field:expr => $validate:expr),*) => { ... };
}Expand description
Does a match on the state struct of a widget. If widget_state.gained_focus() is true
the block is executed. This requires that widget_state implements HasFocus,
but that’s the basic requirement for this whole crate.
ⓘ
use rat_focus::on_gained;
on_gained!(
state.field1 => {
// do prep
},
state.field2 => {
// do prep
}
);