Merge pull request #903 from patriceac/patch-33

Fix autoscroll behavior for the first image
This commit is contained in:
cmdr2 2023-02-20 18:56:52 +05:30 committed by GitHub
commit 380e9aaf13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,10 @@
function Autoscroll(target) {
if (autoScroll.checked && target !== null) {
target.parentElement.parentElement.parentElement.scrollIntoView();
const img = target.querySelector('img')
img.addEventListener('load', function() {
img.closest('.imageTaskContainer').scrollIntoView()
}, { once: true })
}
}
})()