aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-12-20 22:26:38 +0100
committer0neGal <mail@0negal.com>2024-12-20 22:26:38 +0100
commit2ab6eb9eed73bee67ccc0c03d8588fd77358bbf5 (patch)
tree693fe4e8c6ce026b5d6c570d890019d125f65639 /src
parent1da35b8903f20f667086beba96585be4ab32706b (diff)
downloadViper-2ab6eb9eed73bee67ccc0c03d8588fd77358bbf5.tar.gz
Viper-2ab6eb9eed73bee67ccc0c03d8588fd77358bbf5.zip
fixed sort selector with navigation functions
Diffstat (limited to 'src')
-rw-r--r--src/app/index.html2
-rw-r--r--src/app/js/navigate.js15
2 files changed, 11 insertions, 6 deletions
diff --git a/src/app/index.html b/src/app/index.html
index 17e5cf6..06dbcf4 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -259,7 +259,7 @@
<input class="search default-selection" placeholder="%%gui.search%%">
<button class="long" id="sort">
<img src="icons/sort.png" value="unix_created">
- <select>
+ <select class="no-navigate">
<option value="unix_created">%%gui.browser.sort.newest%%</option>
<option value="unix_updated">%%gui.browser.sort.last_updated%%</option>
<option value="rating_score">%%gui.browser.sort.highest_rating%%</option>
diff --git a/src/app/js/navigate.js b/src/app/js/navigate.js
index b5b98a6..9b99df6 100644
--- a/src/app/js/navigate.js
+++ b/src/app/js/navigate.js
@@ -523,19 +523,24 @@ navigate.select = () => {
// focused, which isn't great
//
// so we make the main process send a fake Enter key press
- if (active.closest("select")) {
- active = active.closest("select");
+ if (active.closest("select") || active.querySelector("select")) {
+ // make sure this element doesn't get unselected
+ navigate.dont_unselect = active;
+
+ active = active.closest("select") || active.querySelector("select");
// make sure `<select>` is focused
active.focus();
active.click();
- // make sure this element doesn't get unselected
- navigate.dont_unselect = active;
-
// send fake Enter key to open selection menu
ipcRenderer.send("send-enter-key");
+ // make sure element is unselected
+ active.addEventListener("change", () => {
+ active.blur();
+ }, { once: true })
+
return;
}