mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-01 00:22:17 +00:00
Fix: prevent pdfjs highlight scrolling from affecting the entire page (#13355)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<a [href]="link ?? previewUrl" class="{{linkClasses}}" [target]="linkTarget" [title]="linkTitle"
|
||||
[ngbPopover]="previewContent" [popoverTitle]="document.title | documentTitle" container="body"
|
||||
autoClose="true" [popoverClass]="popoverClass()" (mouseenter)="mouseEnterPreview()" (mouseleave)="mouseLeavePreview()" #popover="ngbPopover">
|
||||
autoClose="true" [popoverClass]="popoverClass()" [popperOptions]="popperOptions"
|
||||
(mouseenter)="mouseEnterPreview()" (mouseleave)="mouseLeavePreview()" #popover="ngbPopover">
|
||||
<ng-content></ng-content>
|
||||
</a>
|
||||
<ng-template #previewContent>
|
||||
|
||||
@@ -67,6 +67,10 @@ describe('PreviewPopupComponent', () => {
|
||||
expect(component.useNativePdfViewer).toBeTruthy()
|
||||
})
|
||||
|
||||
it('should use fixed positioning for the preview popover', () => {
|
||||
expect(component.popperOptions({}).strategy).toEqual('fixed')
|
||||
})
|
||||
|
||||
it('should render object if native PDF viewer enabled', () => {
|
||||
settingsService.set(SETTINGS_KEYS.USE_NATIVE_PDF_VIEWER, true)
|
||||
component.popover.open()
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
ViewChild,
|
||||
} from '@angular/core'
|
||||
import { NgbPopover, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { Options } from '@popperjs/core'
|
||||
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
|
||||
import { first, Subject, takeUntil } from 'rxjs'
|
||||
import { Document } from 'src/app/data/document'
|
||||
@@ -74,6 +75,11 @@ export class PreviewPopupComponent implements OnDestroy {
|
||||
|
||||
readonly popoverClass = signal('shadow popover-preview')
|
||||
|
||||
readonly popperOptions = (options: Partial<Options>): Partial<Options> => ({
|
||||
...options,
|
||||
strategy: 'fixed',
|
||||
})
|
||||
|
||||
get renderAsObject(): boolean {
|
||||
return (this.isPdf && this.useNativePdfViewer) || !this.isPdf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user