From 6fe5a854a712f559ff41f4cd0be741ca854f0245 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 17 Jul 2025 21:44:09 +0300 Subject: [PATCH] feat(views/table): allow deleting relations --- .../view_widgets/table_view/relation_editor.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts index 779659a8d..3b3aed0d2 100644 --- a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts +++ b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts @@ -29,18 +29,15 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel, //set focus on the select box when the editor is selected onRendered(function(){ + let noteId = ""; + note_autocomplete.initNoteAutocomplete($editor, { allowCreatingNotes: true, hideAllButtons: true }).on("autocomplete:noteselected", (event, suggestion, dataset) => { const notePath = suggestion.notePath; - if (!notePath) { - return; - } - - const noteId = notePath.split("/").at(-1); - success(noteId); - }); + noteId = (notePath ?? "").split("/").at(-1); + }).on("blur", () => success(noteId)); editor.focus(); });