mirror of
https://github.com/storytold/egui.git
synced 2026-11-23 19:12:23 +01:00
Do not emit changed responses on unchanged values in selectable_value/radio_value (#2343)
This commit is contained in:
1 parent
f9066ff285
commit
502e1aa229
1 file changed
+2
-2
@@ -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