Skip to content

Commit

Permalink
Merge pull request #16 from tomik23:tomik23/issue15
Browse files Browse the repository at this point in the history
Non-closing list of results
  • Loading branch information
tomickigrzegorz authored Aug 16, 2020
2 parents c3b4855 + 9820f1f commit a358cba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/autosuggest.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1>The Breaking Bad API</h1>
})
.map(el => {
return `
<li class="autocomplete-item" role="option" aria-selected="false" tabindex="-1">
<li class="autocomplete-item" role="option" aria-selected="false">
<p>${el.name.replace(regex, (str) => `<b>${str}</b>`)}</p>
</li>`
}).join('')
Expand Down Expand Up @@ -188,7 +188,7 @@ <h1>The Breaking Bad API</h1>
})
.map(el => {
return `
<li class="autocomplete-item" role="option" aria-selected="false" tabindex="-1">
<li class="autocomplete-item" role="option" aria-selected="false">
<h2 style="margin-bottom: 10px;">${el.name.replace(regex, (str) => `<b style="color: red;">${str}</b>`)}</h2>
<div style="display: flex;">
<div style="margin-right: 10px;">
Expand Down
3 changes: 2 additions & 1 deletion sources/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Autosuggest {
this.outputSearch = document.createElement('ul');
this.outputSearch.id = this.searchOutputUl;
this.outputSearch.className = 'auto-output-search';
this.outputSearch.tabIndex = 0;
this.outputSearch.tabIndex = -1;
this.outputSearch.setAttribute('role', 'listbox');

this.searchId.parentNode.insertBefore(
Expand Down Expand Up @@ -347,6 +347,7 @@ class Autosuggest {

break;

case this.keyCodes.TAB:
case this.keyCodes.ESC:

this.setDefault();
Expand Down

0 comments on commit a358cba

Please sign in to comment.