⚗️ scrollfix

This commit is contained in:
Timur Ercan
2023-02-22 17:54:54 +01:00
parent eb2e15782f
commit 93f731e405

View File

@ -48,10 +48,6 @@ export default function PDFViewer(props) {
onMouseDown={(e) => {
console.log("saving " + window.scrollY);
setScrollPosition(window.scrollY);
setTimeout(() => {
console.log("setting " + scrollPosition);
window.scroll(0, scrollPosition);
}, 0);
props.onMouseDown(e, index);
}}
key={short.generate().toString()}
@ -67,7 +63,10 @@ export default function PDFViewer(props) {
pageNumber={index + 1}
renderAnnotationLayer={false}
renderTextLayer={false}
onLoadSuccess={() => setLoading(false)}
onLoadSuccess={() => {
setLoading(false);
window.scroll(0, scrollPosition);
}}
onRenderError={() => setLoading(false)}
></Page>
{props?.fields