Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
Remove pre-filling of search terms in input box.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Jun 4, 2020
1 parent 3181668 commit aaf4e96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions _assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
return text.replace(new RegExp('(\\b)(' + words.join('|') + ')(\\b)','ig'), '$1<strong>$2</strong>$3');
};

window.initializeAutocomplete = function (autocompleteContainer, defaultValue) {
window.initializeAutocomplete = function (autocompleteContainer) {
const previousInput = autocompleteContainer.querySelector('input');
autocompleteContainer.innerHTML = '';
let runningRequest = null;
Expand All @@ -160,7 +160,6 @@
element: autocompleteContainer,
id: 'search-box',
name: 'query',
defaultValue: defaultValue,
placeholder: previousInput.getAttribute('placeholder'),
confirmOnBlur: false,
onConfirm: (item) => {
Expand Down
2 changes: 1 addition & 1 deletion search/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2 class="title">${highlight(result.title)}</h2>

window.addEventListener('DOMContentLoaded', () => {
const autocompleteContainer = document.querySelector('.autocomplete_container');
window.initializeAutocomplete(autocompleteContainer, query);
window.initializeAutocomplete(autocompleteContainer);

const highlightSearchTerms = !routedFrom;
window.SearchService(query, highlightSearchTerms).then((response) => {
Expand Down

0 comments on commit aaf4e96

Please sign in to comment.