fixed navbar being closed when clicking on input field
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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">
|
<label for="search">
|
||||||
<i class="fas fa-search"></i>
|
<i class="fas fa-search"></i>
|
||||||
</label>
|
</label>
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
title="SteamID64, Profile Link or Custom URL"
|
title="SteamID64, Profile Link or Custom URL"
|
||||||
type="search">
|
type="search">
|
||||||
<button
|
<button
|
||||||
|
id="search-button"
|
||||||
class="btn border-2 btn-outline-info"
|
class="btn border-2 btn-outline-info"
|
||||||
type="button"
|
type="button"
|
||||||
@click="parseSearch"
|
@click="parseSearch"
|
||||||
@@ -160,8 +161,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('click', () => {
|
document.addEventListener('click', (e) => {
|
||||||
closeNav()
|
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