0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-29 14:34:39 +01:00
gitea/web_src/js/features/autofocus-end.js

6 lines
287 B
JavaScript

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