Fix scroll preservation on reader setting changes
Observers got disconnected and started again. Since the images have already been rendered at this point of time, the mutation observer on the scroll element does not detect them anymore. Thus, exiting image resizes were not observed anymore and did not trigger the preservation logic
This commit is contained in:
@@ -58,7 +58,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
- (**Reader**) Fix chapter not getting marked as read in continuous reading mode in case the last page is not big enough to get marked as the current page
|
- (**Reader**) Fix chapter not getting marked as read in continuous reading mode in case the last page is not big enough to get marked as the current page
|
||||||
- (**Reader**) Fix infinite scrolling sometimes not opening previous/next chapter
|
- (**Reader**) Fix infinite scrolling sometimes not opening previous/next chapter
|
||||||
- (**Reader**) Fix infinite scroll immediately opening previous chapter with disabled transition page when opening reader
|
- (**Reader**) Fix infinite scroll immediately opening previous chapter with disabled transition page when opening reader
|
||||||
- (**Reader**) Fix preserving scroll position with RTL reading direction and a language that is read RTL
|
- (**Reader**) Fix preserving scroll position
|
||||||
- (**Reader**) Fix missing gap between chapters in continuous vertical and horizontal reading modes with disabled transition page
|
- (**Reader**) Fix missing gap between chapters in continuous vertical and horizontal reading modes with disabled transition page
|
||||||
- (**Browse**) Fix showing only nsfw sources in the browse source page when the "show nsfw" setting is disabled
|
- (**Browse**) Fix showing only nsfw sources in the browse source page when the "show nsfw" setting is disabled
|
||||||
- (**Manga/Library**) Fix mark as read/unread option not being disabled for manga without any chapters
|
- (**Manga/Library**) Fix mark as read/unread option not being disabled for manga without any chapters
|
||||||
|
|||||||
@@ -164,10 +164,14 @@ const useScrollPreservationData = (
|
|||||||
updateObservation(entry.removedNodes, (element) => intersectionObserver.unobserve(element));
|
updateObservation(entry.removedNodes, (element) => intersectionObserver.unobserve(element));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mutationObserver.observe(scrollElement, {
|
mutationObserver.observe(scrollElement, {
|
||||||
childList: true,
|
childList: true,
|
||||||
subtree: true,
|
subtree: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateObservation(scrollElement.childNodes, (element) => intersectionObserver.observe(element));
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
mutationObserver.disconnect();
|
mutationObserver.disconnect();
|
||||||
intersectionObserver.disconnect();
|
intersectionObserver.disconnect();
|
||||||
@@ -253,6 +257,8 @@ const usePreserveOnLeadingPageRender = (
|
|||||||
subtree: true,
|
subtree: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateObservation(scrollElement.childNodes, (element) => resizeObserver.observe(element));
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
mutationObserver.disconnect();
|
mutationObserver.disconnect();
|
||||||
resizeObserver.disconnect();
|
resizeObserver.disconnect();
|
||||||
@@ -347,6 +353,8 @@ const usePreserveOnInfiniteScrollPreviousChapterInitialRender = (
|
|||||||
subtree: true,
|
subtree: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateObservation(scrollElement.childNodes, (element) => resizeObserver.observe(element));
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
mutationObserver.disconnect();
|
mutationObserver.disconnect();
|
||||||
resizeObserver.disconnect();
|
resizeObserver.disconnect();
|
||||||
|
|||||||
Reference in New Issue
Block a user