code.gitea.io/gitea@v1.22.3/web_src/js/features/autofocus-end.js (about)

     1  export function initAutoFocusEnd() {
     2    for (const el of document.querySelectorAll('.js-autofocus-end')) {
     3      el.focus(); // expects only one such element on one page. If there are many, then the last one gets the focus.
     4      el.setSelectionRange(el.value.length, el.value.length);
     5    }
     6  }