mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
UX fix: when the user clicks on the search input, don't move the cursor at the end
Related to https://github.com/searxng/searxng/pull/1153#issuecomment-1154247988
This commit is contained in:
parent
9b0b6a2c90
commit
fe1683c9c6
2 changed files with 7 additions and 20 deletions
|
|
@ -317,7 +317,12 @@ searxng.ready(function () {
|
|||
|
||||
function searchInputFocus () {
|
||||
window.scrollTo(0, 0);
|
||||
document.querySelector('#q').focus();
|
||||
var q = document.querySelector('#q');
|
||||
q.focus();
|
||||
if (q.setSelectionRange) {
|
||||
var len = q.value.length;
|
||||
q.setSelectionRange(len, len);
|
||||
}
|
||||
}
|
||||
|
||||
function openResult (newTab) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue