Search is automatically reset when an item is opened

This commit is contained in:
Alicia Sykes
2021-04-03 09:08:28 +01:00
parent dfdef736e2
commit fb60e63252
9 changed files with 84 additions and 42 deletions

View File

@@ -17,6 +17,7 @@
<div class="space-filler">
<span>hello</span>
<span>world</span>
<i class="fas fa-rocket" style="color: red;"></i>
</div>
<KeyboardShortcutInfo />
</section>
@@ -47,7 +48,7 @@ export default {
},
mounted() {
window.addEventListener('keyup', (event) => {
const { key } = event;
const { key, keyCode } = event;
if (/^[a-zA-Z]$/.test(key) && !document.activeElement.id) {
try {
this.input += key;
@@ -56,6 +57,8 @@ export default {
} catch (e) {
// Do nothing
}
} else if (keyCode === 27) {
this.clearFilterInput();
}
});
},