From e4b754a19fd39b4494816a7e4e0c9e2115a6a886 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:03:24 -0400 Subject: [PATCH] settings ui: Fix dropdown menu rendering the same entries for different settings (#38083) Using `window.use_state` made the element IDs match between elements, thus causing the same menu to be shared for drop down menus. I switched to `window.use_keyed_state` and used a value's path as it's element id Release Notes: - N/A --- crates/settings_ui/src/settings_ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index f448508971dbeb58126259be10111833fe4bb252..6d79b838743bb23f1bce7b409360f04929431df6 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -909,7 +909,7 @@ fn render_dropdown( let value = downcast_any_item::(value); let id = element_id_from_path(&value.path); - let menu = window.use_state(cx, |window, cx| { + let menu = window.use_keyed_state(id.clone(), cx, |window, cx| { let path = value.path.clone(); let handler = Rc::new(move |variant: &'static str, cx: &mut App| { SettingsValue::write_value(&path, serde_json::Value::String(variant.to_string()), cx);