huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
242 stars 80 forks source link

Clicking on a TOC chapter ABOVE the current scrolling position does not update URL nor page number #6855

Open RafaPolit opened 5 months ago

RafaPolit commented 5 months ago

Describe the bug If you navigate the TOC chapters from top-to-bottom, the page URL changes correctly.

If you try to navigate from a higher page number (having scrolled in the document or following a chapter link) to a PREVIOUS chapter, neither the URL nor the page number get updated.

To Reproduce Steps to reproduce the behavior:

  1. Create a TOC for a PDF that has chapters spawning multiple pages
  2. Scroll to the bottom of the PDF, and confirm you are on page X (58/60 for example)
  3. Click on chapter that scrolls UP to a previous page
  4. Confirm that the page has NOT changed and is, actually, wrong
  5. Scroll a bit (with mouse wheel, for example) and the page "snaps" to the right values
  6. If you do this "the other way around" and go from a lower-numbered page to a higher-numbered page chapter, the value updates correctly.