Skip to content

Commit 474ebf0

Browse files
xTiborJohannesProgrammiert
authored andcommitted
Do not emit changed responses on unchanged values in selectable_value/radio_value (emilk#2343)
1 parent d2d0488 commit 474ebf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/egui/src/ui.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ impl Ui {
14471447
text: impl Into<WidgetText>,
14481448
) -> Response {
14491449
let mut response = self.radio(*current_value == alternative, text);
1450-
if response.clicked() {
1450+
if response.clicked() && *current_value != alternative {
14511451
*current_value = alternative;
14521452
response.mark_changed();
14531453
}
@@ -1475,7 +1475,7 @@ impl Ui {
14751475
text: impl Into<WidgetText>,
14761476
) -> Response {
14771477
let mut response = self.selectable_label(*current_value == selected_value, text);
1478-
if response.clicked() {
1478+
if response.clicked() && *current_value != selected_value {
14791479
*current_value = selected_value;
14801480
response.mark_changed();
14811481
}

0 commit comments

Comments
 (0)