Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings ui: Fix dropdown menu rendering the same entries for different settings (#38083)

Anthony Eide4b754a19fd3
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index f448508971d..6d79b838743 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::<String>(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);