Skip to content

Commit c4d0afb

Browse files
committed
fix editor demo - check for valid object key when pressing enter
1 parent f86c146 commit c4d0afb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demo/src/apps/editor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ impl Editor {
8484
.is_some_and(|obj| !obj.contains_key(&state.new_key_input));
8585

8686
ui.add_enabled_ui(valid_key, |ui| {
87-
if ui.small_button("✅").clicked() || enter_was_pressed_with_focus {
87+
if ui.small_button("✅").clicked()
88+
|| (valid_key && enter_was_pressed_with_focus)
89+
{
8890
edit_events.push(EditEvent::SaveObjectKeyEdit);
8991
}
9092
});

0 commit comments

Comments
 (0)