box-annotations 4.1.1-beta.1 → 4.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-annotations",
3
- "version": "4.1.1-beta.1",
3
+ "version": "4.1.1-beta.2",
4
4
  "description": "Box Annotations",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -39,6 +39,10 @@ export function getSelection(): Selection | null {
39
39
  // We only care about the last range
40
40
  let range = selection.getRangeAt(selection.rangeCount - 1);
41
41
 
42
+ // Changes to the text layer in PDFjs v2.14.305 require the start range to be set manually for correct highlighting behavior
43
+ const startRange = selection.getRangeAt(0);
44
+ range.setStart(startRange.startContainer, startRange.startOffset);
45
+
42
46
  const containerEl = findClosestElWithClass(range.endContainer as Element, 'textLayer');
43
47
  const startPage = getPageNumber(range.startContainer as Element);
44
48
  const endPage = getPageNumber(range.endContainer as Element);