hypothesis / client

The Hypothesis web-based annotation client.
Other
641 stars 197 forks source link

PDF text selection rect can be confusing in Safari #5086

Open robertknight opened 1 year ago

robertknight commented 1 year ago

Text selections in VitalSource PDF books can sometimes produce overly-large selection rectangles in Safari that make it hard to discern where the selection ends.

Steps to reproduce:

  1. Go to http://localhost:3000/document/vitalsource-pdf
  2. Make a text selection that begins just before "Chapter 2" and ends just after "Production possibilities"

In Chrome, the selection looks like this:

Text selection in Chrome

In Safari, the same selection looks like this:

Text selection in Safari
robertknight commented 1 year ago

This is most likely related to the first <hypothesis-text-column> element (red background) overlapping with the second (yellow background). The bullet point characters are part of the first column, but the text of the bullet points are part of the second column.

Overlapping columns
robertknight commented 1 year ago

This issue is likely to come up if we try re-using ImageTextLayer in (non-VitalSource) PDFs - https://github.com/hypothesis/client/issues/5023