git.lucas.co / cce-data-editor
structured data editor
git clone https://git.lucas.co/cce-data-editor.git

commit40bbc5f63e6368ed03b91298ded30faaa8db068d
parent685ad39e12
authorLucas Galante <[email protected]>
date2026-06-29 20:35
Fix inline editors getting overwritten by tree list selection click handler

 src/main.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index e853eb8..3639fcb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1323,26 +1323,33 @@ impl Application for DataEditorApp {
             }
         }
 
+        let mut editor_handled = false;
         if self.new_key_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
         if self.selected_value_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
         if self.selected_color_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
         if self.selected_spinbox_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
         if self.selected_font_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
         if self.raw_json_editor.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
+            editor_handled = true;
         }
 
-        if self.tree_list.mouse_input(button, state, px, py, &mut self.ui_context) {
+        if !editor_handled && self.tree_list.mouse_input(button, state, px, py, &mut self.ui_context) {
             changed = true;
             if let Some(clicked_item) = self.tree_list.take_clicked_item() {
                 match clicked_item {