react-logviewer
react-logviewer copied to clipboard
scrollToLine={100} does not scroll to line 100
I have a downstream application where i need to render large text documents ( > 100 lines) .
for this, i also need to generate links to specific lines within these documents, which will translate to scrollToLine={line_number} props to the LazyLog object.
Unfortunately, when passing text={LARGE_TEXT_DOCUMENT}, scrollToLine={100} it scrolls to line 40 but no farther.
"@melloware/react-logviewer": "^5.1.1",
return (
<div style={{ height: "80vh" }}>
<LazyLog
text={data}
enableHotKeys={false}
enableSearch={false}
enableSearchNavigation={false}
onLineNumberClick={(event) => {
console.log(`onLineNumberClick: on line ${event.lineNumber}`);
}}
scrollToLine={100}
highlight={100}
/>
</div>
);
i will investigate
I published 5.2.0 can you try again? there was definitely a bug with scrollToLine but not sure if it fixes your exact issue.
No its still happening: https://stackblitz.com/edit/vitejs-vite-zsocn6?file=src%2FApp.tsx&terminal=dev
OK 5.2.1 is out and I fixed it. It had some legacy forceUpdate code from the old library that was breaking it.
OK fixed for real in 5.2.2