Skip to content

Commit f2da47c

Browse files
committed
Update spotlightsearch.js
1 parent 3af754f commit f2da47c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spotlightsearch.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ searchInput.addEventListener('input', () => {
7171

7272
})
7373

74+
// disable enter key in search input
75+
searchInput.addEventListener('keydown', (e) => {
76+
77+
if (e.key === 'Enter') {
78+
e.preventDefault();
79+
}
80+
81+
});
82+
7483
// clear search input when clicked on button
7584
searchClear.addEventListener('click', () => {
7685

0 commit comments

Comments
 (0)