mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Do not emit changed responses on unchanged values in selectable_value/radio_value (#2343)
This commit is contained in:
@@ -1447,7 +1447,7 @@ impl Ui {
|
||||
text: impl Into<WidgetText>,
|
||||
) -> Response {
|
||||
let mut response = self.radio(*current_value == alternative, text);
|
||||
if response.clicked() {
|
||||
if response.clicked() && *current_value != alternative {
|
||||
*current_value = alternative;
|
||||
response.mark_changed();
|
||||
}
|
||||
@@ -1475,7 +1475,7 @@ impl Ui {
|
||||
text: impl Into<WidgetText>,
|
||||
) -> Response {
|
||||
let mut response = self.selectable_label(*current_value == selected_value, text);
|
||||
if response.clicked() {
|
||||
if response.clicked() && *current_value != selected_value {
|
||||
*current_value = selected_value;
|
||||
response.mark_changed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user