diff options
author | Mark Otto <markd.otto@gmail.com> | 2021-12-03 10:47:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 10:47:31 +0300 |
commit | d8c52acc3b0fbe94080aa6cce558b374f43eaec3 (patch) | |
tree | 4bb8ffd1b9a890c0cf2fc52dd1e2fec800f175c7 /docs | |
parent | efc7db88af10a42f7e9e25f5800ebb364440ceda (diff) |
Disable enter key on icon search (#1120)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/assets/js/application.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 00e068428..cd734929c 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -45,7 +45,16 @@ errorElement.classList.remove('d-none') errorElement.insertAdjacentHTML('afterbegin', fallbackMsg) - }); + }) + + var searchInput = document.getElementById('search') + if (searchInput) { + searchInput.addEventListener('keydown', function (event) { + if (event.key === 'Enter') { + event.preventDefault() + } + }) + } // Disable empty links in docs [].slice.call(document.querySelectorAll('[href="#"]')) |