fix(web): lecteur CBZ/CBR mode vertical — capturer naturalWidth/naturalHeight avant neutralisation de currentTarget par React (régression #37)

This commit is contained in:
Git Agent
2026-08-24 16:32:27 +02:00
parent 902cf8560b
commit 4d5f7cfb07
2 changed files with 96 additions and 1 deletions

View File

@ -217,9 +217,10 @@ export function CbzReader({
loading="lazy"
style={verticalImageStyle(item.page)}
onLoad={(event) => {
const { naturalWidth, naturalHeight } = event.currentTarget;
setImageSizes((current) => ({
...current,
[item.page]: { width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }
[item.page]: { width: naturalWidth, height: naturalHeight }
}));
}}
onError={() => setPageError(`Page ${item.page} indisponible.`)}