summaryrefslogtreecommitdiff
path: root/client/simple/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/simple/src')
-rw-r--r--client/simple/src/js/main/search.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/simple/src/js/main/search.ts b/client/simple/src/js/main/search.ts
index cbf41a205..c7ce9e090 100644
--- a/client/simple/src/js/main/search.ts
+++ b/client/simple/src/js/main/search.ts
@@ -40,6 +40,18 @@ if (!(isMobile || isResultsPage)) {
qInput.focus();
}
+// On mobile, move cursor to the end of the input on focus
+if (isMobile) {
+ listen("focus", qInput, () => {
+ // Defer cursor move until the next frame to prevent a visual jump
+ requestAnimationFrame(() => {
+ const end = qInput.value.length;
+ qInput.setSelectionRange(end, end);
+ qInput.scrollLeft = qInput.scrollWidth;
+ });
+ });
+}
+
createClearButton(qInput);
// Additionally to searching when selecting a new category, we also