anaralabs / anaralabs/lector

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

Aberta
#38 0 comentários 2 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
395
Forks
39
Merge médio
7h 7min
PRs com merge (30d)
12

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.