Skip to content

Commit

Permalink
mark the response of a toggle_value as changed on click (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonogram committed May 4, 2022
1 parent d3af3a6 commit 1dd014c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion egui/src/ui.rs
Expand Up @@ -1381,9 +1381,10 @@ impl Ui {
///
/// See also [`Self::checkbox`].
pub fn toggle_value(&mut self, selected: &mut bool, text: impl Into<WidgetText>) -> Response {
let response = self.selectable_label(*selected, text);
let mut response = self.selectable_label(*selected, text);
if response.clicked() {
*selected = !*selected;
response.mark_changed();
}
response
}
Expand Down

0 comments on commit 1dd014c

Please sign in to comment.