scroll when image loads

master
Aevann 2024-11-13 03:10:12 +02:00
parent 93da418c16
commit c0fbb39869
1 changed files with 3 additions and 1 deletions

View File

@ -403,7 +403,9 @@ function handle_files() {
document.getElementById('image-preview').setAttribute('src', this.result); document.getElementById('image-preview').setAttribute('src', this.result);
document.getElementById('image-preview').classList.remove('d-none'); document.getElementById('image-preview').classList.remove('d-none');
document.getElementById('image-preview').classList.add('mr-2'); document.getElementById('image-preview').classList.add('mr-2');
box.scrollTo(0, box.scrollHeight) document.getElementById('image-preview').addEventListener('load', () => {
box.scrollTo(0, box.scrollHeight)
})
}; };
} }
else { else {