Skip to content

Build your personal knowledge base with Trilium Notes

style(views/table): improve autocomplete styling

Elian Dorandcad23316d37
diff --git a/apps/client/src/widgets/view_widgets/table_view/index.ts b/apps/client/src/widgets/view_widgets/table_view/index.ts
index bd65176d19..a16cbb9c5c 100644
--- a/apps/client/src/widgets/view_widgets/table_view/index.ts
+++ b/apps/client/src/widgets/view_widgets/table_view/index.ts
@@ -34,6 +34,14 @@ const TPL = /*html*/`
right: 0;
bottom: 0;
}
+
+ .tabulator-cell .autocomplete {
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ background: transparent;
+ outline: none !important;
+ }
</style>
<div class="header">
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 9db63af14f..6a1bc334bd 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
@@ -12,6 +12,7 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel,
//create and style editor
const editor = document.createElement("input");
+
const $editor = $(editor);
editor.classList.add("form-control");
@@ -43,8 +44,11 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel,
editor.focus();
});
- //return the editor element
- return editor;
+ const container = document.createElement("div");
+ container.classList.add("input-group");
+ container.classList.add("autocomplete");
+ container.appendChild(editor);
+ return container;
};
export function RelationFormatter(cell: CellComponent, formatterParams, onRendered) {