Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-12-11 05:51:57 +01:00
forgejo/web_src/js/features/autofocus-end.js
2024-03-30 07:17:31 +01:00

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);
}
}