mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 13:45:19 +00:00
7 lines
287 B
JavaScript
7 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);
|
||
|
}
|
||
|
}
|