diff --git a/remarkbox/static/js/custom.js b/remarkbox/static/js/custom.js index d169039..4513446 100644 --- a/remarkbox/static/js/custom.js +++ b/remarkbox/static/js/custom.js @@ -147,6 +147,16 @@ function initThreadTitleTypeahead() { }, 400); }); + // Clicking a suggestion navigates to that thread. + suggestionsDiv.addEventListener('click', function(e) { + var link = e.target.closest('.suggestion-item'); + if (link && link.href) { + e.preventDefault(); + e.stopPropagation(); + window.location.href = link.href; + } + }); + // Hide suggestions when clicking outside. document.addEventListener('click', function(e) { if (e.target !== titleInput && !suggestionsDiv.contains(e.target)) { diff --git a/remarkbox/templates/snippets/forms.j2 b/remarkbox/templates/snippets/forms.j2 index 23d4d5f..4f05bd9 100644 --- a/remarkbox/templates/snippets/forms.j2 +++ b/remarkbox/templates/snippets/forms.j2 @@ -49,7 +49,7 @@ {% if node.title %}