⚗️ scrollfix
This commit is contained in:
@@ -48,10 +48,6 @@ export default function PDFViewer(props) {
|
|||||||
onMouseDown={(e) => {
|
onMouseDown={(e) => {
|
||||||
console.log("saving " + window.scrollY);
|
console.log("saving " + window.scrollY);
|
||||||
setScrollPosition(window.scrollY);
|
setScrollPosition(window.scrollY);
|
||||||
setTimeout(() => {
|
|
||||||
console.log("setting " + scrollPosition);
|
|
||||||
window.scroll(0, scrollPosition);
|
|
||||||
}, 0);
|
|
||||||
props.onMouseDown(e, index);
|
props.onMouseDown(e, index);
|
||||||
}}
|
}}
|
||||||
key={short.generate().toString()}
|
key={short.generate().toString()}
|
||||||
@@ -67,7 +63,10 @@ export default function PDFViewer(props) {
|
|||||||
pageNumber={index + 1}
|
pageNumber={index + 1}
|
||||||
renderAnnotationLayer={false}
|
renderAnnotationLayer={false}
|
||||||
renderTextLayer={false}
|
renderTextLayer={false}
|
||||||
onLoadSuccess={() => setLoading(false)}
|
onLoadSuccess={() => {
|
||||||
|
setLoading(false);
|
||||||
|
window.scroll(0, scrollPosition);
|
||||||
|
}}
|
||||||
onRenderError={() => setLoading(false)}
|
onRenderError={() => setLoading(false)}
|
||||||
></Page>
|
></Page>
|
||||||
{props?.fields
|
{props?.fields
|
||||||
|
|||||||
Reference in New Issue
Block a user