on_lost

Macro on_lost 

Source
macro_rules! on_lost {
    ($($field:expr => $validate:expr),*) => { ... };
}
Expand description

Does a match on the state struct of a widget. If widget_state.lost_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_lost;

on_lost!(
    state.field1 => {
        // do checks
    },
    state.field2 => {
        // do checks
    }
);