box / box-content-preview

JavaScript library for rendering files stored on Box
https://developer.box.com/docs/box-content-preview
Other
106 stars 113 forks source link

fix(preview): Fix highlighting text when performing click and drag #1531

Closed bkepka-box closed 3 months ago

bkepka-box commented 3 months ago

Fix highlighting text in Preview. This bug was introduced as a regression during PDF.js upgrade.

Root cause description

Inside this commit PDF.js team removed z-index:2 from .textLayer class which is causing a bug that user cannot highlight text when annotations are enabled.

Screenshots

2.108.0 version (current):

image

2.107.0 version:

image
bkepka-box commented 3 months ago

We need to set z-index to 1 because with 2 it breaks annotation links (for example internal link to page like in the test/integration/document/PresentationViewer.e2e.test.js test). It is because also z-index:3 was removed from annotationLayer in the same pdf.js PR.