Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not emit changed responses on unchanged values in selectable_value/radio_value #2343

Merged
merged 1 commit into from Nov 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/egui/src/ui.rs
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down