Grow the Add stories field to fit its URLs

This commit is contained in:
tim
2026-09-27 23:38:28 +02:00
parent ce19035689
commit a7a89b145c
3 changed files with 16 additions and 1 deletions
+8
View File
@@ -227,6 +227,13 @@ export function storiesPage(main, _params, config) {
rows: 3,
placeholder: 'https://www.royalroad.com/fiction/… (one URL per line)',
'aria-label': 'Story URLs',
// Phones give no handle to resize a textarea, so the field grows to fit its URLs. It never
// shrinks, so a size set with the handle on a desktop stays.
oninput: () => {
if (urls.scrollHeight > urls.clientHeight) {
urls.style.height = `${urls.scrollHeight + urls.offsetHeight - urls.clientHeight}px`;
}
},
});
const add = button(
'Add',
@@ -237,6 +244,7 @@ export function storiesPage(main, _params, config) {
if (result.jobs.length) {
toast(`Queued ${result.jobs.length} ${result.jobs.length === 1 ? 'story' : 'stories'}`);
urls.value = '';
urls.style.height = '';
refreshJobs();
}
},