fixed navbar being closed when clicking on input field
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" @keydown.enter.prevent="parseSearch">
|
||||
<form id="searchform" class="d-flex" @keydown.enter.prevent="parseSearch" @submit.prevent="parseSearch">
|
||||
<label for="search">
|
||||
<i class="fas fa-search"></i>
|
||||
</label>
|
||||
@@ -30,6 +30,7 @@
|
||||
title="SteamID64, Profile Link or Custom URL"
|
||||
type="search">
|
||||
<button
|
||||
id="search-button"
|
||||
class="btn border-2 btn-outline-info"
|
||||
type="button"
|
||||
@click="parseSearch"
|
||||
@@ -160,7 +161,11 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', () => {
|
||||
document.addEventListener('click', (e) => {
|
||||
if (e.target.attributes.id) {
|
||||
if (e.target.attributes.id.name === 'searchform' || e.target.attributes.id.name === 'search' || e.target.attributes.id.name === 'search-button')
|
||||
console.log('test')
|
||||
} else
|
||||
closeNav()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user