anaralabs / anaralabs/lector

`NaN` is an invalid value for the `width` css style property.

未關閉
#38 0 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
395
分支
39
平均合併
7 小時 7 分鐘
30 天內合併 PR
12

描述

initial search result jump is causing console error, next jumps are fine

Image

```
import { calculateHighlightRects, SearchResult, usePdf, usePdfJump } from "@unriddle-ai/lector";

const usePdfPreview = () => {
const { jumpToHighlightRects } = usePdfJump();
const getPdfPageProxy = usePdf(state => state.getPdfPageProxy);

const jumpToText = async (result: SearchResult) => {
const pageProxy = getPdfPageProxy(result.pageNumber);
const rects = await calculateHighlightRects(pageProxy, {
pageNumber: result.pageNumber,
text: result.text,
matchIndex: result.matchIndex,
});
jumpToHighlightRects(rects, "pixels");
};

return { jumpToText };
};

export default usePdfPreview;
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。