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

View File

@ -39,7 +39,10 @@
function Autoscroll(target) { function Autoscroll(target) {
if (autoScroll.checked && target !== null) { 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 })
} }
} }
})() })()