Skip to content

Build your personal knowledge base with Trilium Notes

fix(attributes): attribute detail not showing up for first item (closes #6948)

Elian Dorancd9b46e1c7c4
diff --git a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
index 18c4a3b93a..edae4f014f 100644
--- a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
+++ b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
@@ -337,7 +337,8 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
let matchedAttr: Attribute | null = null;
for (const attr of parsedAttrs) {
- if (attr.startIndex && clickIndex > attr.startIndex && attr.endIndex && clickIndex <= attr.endIndex) {
+ if (attr.startIndex !== undefined && clickIndex > attr.startIndex &&
+ attr.endIndex !== undefined && clickIndex <= attr.endIndex) {
matchedAttr = attr;
break;
}