Skip to content

Build your personal knowledge base with Trilium Notes

promoted attributes have tabindex following the title and before note content

azivner297b536ebcab
diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js
index 862f0cf9da..3d4852bfb0 100644
--- a/src/public/javascripts/services/note_detail.js
+++ b/src/public/javascripts/services/note_detail.js
@@ -228,15 +228,16 @@ async function loadAttributes() {
const promoted = attributes.filter(attr => (attr.type === 'label-definition' || attr.type === 'relation-definition') && attr.value.isPromoted);
- let idx = 1;
+ let idx = 2; // because idx is also tabIndex and 1 is the title
async function createRow(definitionAttr, valueAttr) {
const definition = definitionAttr.value;
- const inputId = "promoted-input-" + (idx++);
+ const inputId = "promoted-input-" + idx;
const $tr = $("<tr>");
const $labelCell = $("<th>").append(valueAttr.name);
const $input = $("<input>")
.prop("id", inputId)
+ .prop("tabindex", idx)
.prop("attribute-id", valueAttr.isOwned ? valueAttr.attributeId : '') // if not owned, we'll force creation of a new attribute instead of updating the inherited one
.prop("attribute-type", valueAttr.type)
.prop("attribute-name", valueAttr.name)
@@ -244,6 +245,8 @@ async function loadAttributes() {
.addClass("form-control")
.addClass("promoted-attribute-input");
+ idx++;
+
const $inputCell = $("<td>").append($("<div>").addClass("input-group").append($input));
const $actionCell = $("<td>");
diff --git a/src/public/javascripts/services/note_detail_code.js b/src/public/javascripts/services/note_detail_code.js
index 8748e45398..3cd9fc099f 100644
--- a/src/public/javascripts/services/note_detail_code.js
+++ b/src/public/javascripts/services/note_detail_code.js
@@ -32,7 +32,7 @@ async function show() {
lint: true,
gutters: ["CodeMirror-lint-markers"],
lineNumbers: true,
- tabindex: 2 // so that tab from title will lead to code editor focus
+ tabindex: 100
});
codeEditor.on('change', noteDetailService.noteChanged);
diff --git a/src/views/index.ejs b/src/views/index.ejs
index 87adfe7d99..d39a25f97c 100644
--- a/src/views/index.ejs
+++ b/src/views/index.ejs
@@ -184,7 +184,7 @@
<table id="note-detail-promoted-attributes"></table>
<div id="note-detail-component-wrapper">
- <div id="note-detail-text" class="note-detail-component" tabindex="2"></div>
+ <div id="note-detail-text" class="note-detail-component" tabindex="100"></div>
<div id="note-detail-search" class="note-detail-component">
<div style="display: flex; align-items: center;">