There are two modes, reactive and continuous. You can switch between them here in the backend tab:
https://www.egui.rs/
Reactive mode is the one you are looking for.