This commit is contained in:
shamoon 2025-01-23 12:56:43 -08:00
parent 7df631f1b0
commit 90eb7c3713
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -170,7 +170,7 @@ describe('PreviewPopupComponent', () => {
dispatch: jest.fn(),
} as any)
const dispatchSpy = jest.spyOn(component.pdfViewer.eventBus, 'dispatch')
component.onViewerLoaded()
component.onPageRendered()
expect(dispatchSpy).toHaveBeenCalledWith('find', {
query: 'test',
caseSensitive: false,

View File

@ -116,7 +116,8 @@ export class PreviewPopupComponent implements OnDestroy {
}
}
onViewerLoaded() {
onPageRendered() {
// Only triggered by the pngx pdf viewer
if (this.documentService.searchQuery) {
this.pdfViewer.eventBus.dispatch('find', {
query: this.documentService.searchQuery,