Skip to content

Commit

Permalink
Fix conflicting text edit ui element ids (#75)
Browse files Browse the repository at this point in the history
Fixes #74 by manually setting the root `Id` for the node creator UI.
  • Loading branch information
mbrea-c authored Oct 24, 2024
1 parent 58ec33d commit 90ed02f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/bevy_animation_graph_editor/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::hash::{Hash, Hasher};
use std::path::PathBuf;

use crate::asset_saving::{SaveFsm, SaveGraph};
Expand Down Expand Up @@ -1060,7 +1061,15 @@ impl TabViewer<'_> {
};
let mut env = InspectorUi::for_bevy(&type_registry, &mut cx);

env.ui_for_reflect(&mut selection.node_creation.node, ui);
let mut hasher = std::collections::hash_map::DefaultHasher::new();
"Create node".hash(&mut hasher);
let node_creator_id = egui::Id::new(hasher.finish());
env.ui_for_reflect_with_options(
&mut selection.node_creation.node,
ui,
node_creator_id,
&(),
);
let submit_response = ui.button("Create node");

if submit_response.clicked() && selection.graph_editor.is_some() {
Expand Down

0 comments on commit 90ed02f

Please sign in to comment.