From e0bac4e2604bdb3937ff8e846b218bdb5cb1dd36 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Tue, 24 Feb 2026 11:07:55 +0100 Subject: [PATCH] Pass in an explicit id in `UiBuilder`, to avoid wrapping passed in ids with Id::new() (#7925) I was really confused why I couldn't find the response for my ui with explicit id. Turns out the id I passed in was wrapped by `Id::new` --- crates/egui/src/ui_builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/egui/src/ui_builder.rs b/crates/egui/src/ui_builder.rs index 686fdcb47..87786a726 100644 --- a/crates/egui/src/ui_builder.rs +++ b/crates/egui/src/ui_builder.rs @@ -54,8 +54,8 @@ impl UiBuilder { /// /// This is a shortcut for `.id_salt(my_id).global_scope(true)`. #[inline] - pub fn id(mut self, id: impl Hash) -> Self { - self.id_salt = Some(Id::new(id)); + pub fn id(mut self, id: Id) -> Self { + self.id_salt = Some(id); self.global_scope = true; self }