From 7221a3db4f7d465bcde5187174e52aa344d4692d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marseault?= <22910497+Larsluph@users.noreply.github.com> Date: Thu, 15 Jun 2023 14:04:03 +0200 Subject: [PATCH] perf: Allow native find (#864) --- src/views/Dashboard.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 625366a9..61c21e96 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -450,10 +450,12 @@ export default { // 'ctrl + F' => Focus search filter field if (e.keyCode === 70 && doesCommand(e)) { - e.preventDefault() - - this.searchFilterEnabled = true - document.getElementById('searchInput').focus() + const searchInput = document.getElementById('searchInput') + if (document.activeElement !== searchInput) { + e.preventDefault() + this.searchFilterEnabled = true + searchInput.focus() + } } // 'Escape' => Remove focus from search field