react-logviewer icon indicating copy to clipboard operation
react-logviewer copied to clipboard

scrollToLine={100} does not scroll to line 100

Open theunkn0wn1 opened this issue 1 year ago • 3 comments

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>
  );

theunkn0wn1 avatar Jul 29 '24 21:07 theunkn0wn1

i will investigate

melloware avatar Jul 29 '24 21:07 melloware

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.

melloware avatar Jul 30 '24 20:07 melloware

No its still happening: https://stackblitz.com/edit/vitejs-vite-zsocn6?file=src%2FApp.tsx&terminal=dev

melloware avatar Jul 30 '24 20:07 melloware

OK 5.2.1 is out and I fixed it. It had some legacy forceUpdate code from the old library that was breaking it.

melloware avatar Sep 07 '24 12:09 melloware

OK fixed for real in 5.2.2

melloware avatar Sep 09 '24 19:09 melloware