@bendyline/squisq-react 2.12.20 → 2.12.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-MUYICTDA.js → chunk-MIJNUVEL.js} +3 -1
- package/dist/index.js +1 -1
- package/dist/page/index.js +1 -1
- package/dist/squisq-player.full.global.js +478 -476
- package/dist/squisq-player.global.js +85 -83
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +2 -2
|
@@ -59,6 +59,8 @@ function PaginatedDocView({
|
|
|
59
59
|
const [currentPage, setCurrentPage] = useState(
|
|
60
60
|
() => Math.min(Math.max(0, initialPage), lastPage)
|
|
61
61
|
);
|
|
62
|
+
const currentPageRef = useRef(currentPage);
|
|
63
|
+
currentPageRef.current = currentPage;
|
|
62
64
|
const scrollRef = useRef(null);
|
|
63
65
|
const pendingPageRef = useRef(null);
|
|
64
66
|
const pendingPageTimeoutRef = useRef(null);
|
|
@@ -102,7 +104,7 @@ function PaginatedDocView({
|
|
|
102
104
|
if (!container) return;
|
|
103
105
|
const keys = JSON.parse(pageKeys);
|
|
104
106
|
const previous = previousLayoutRef.current;
|
|
105
|
-
const selected = pendingPageRef.current ??
|
|
107
|
+
const selected = pendingPageRef.current ?? currentPageRef.current;
|
|
106
108
|
const preserveSelection = previous && previous.initialPage === initialPage && (selected > 0 || pendingPageRef.current !== null);
|
|
107
109
|
const retained = preserveSelection ? keys.indexOf(previous.keys[selected]) : -1;
|
|
108
110
|
const requested = preserveSelection ? retained >= 0 ? retained : selected : initialPage;
|
package/dist/index.js
CHANGED