Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8250779

Anchor is ignored when reloading a page in Chrome

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 16
    • 16
    • tools

    Description

      With JDK-8249133 we fixed the problem of the back/forward buttons not working with anchor links, but it seems we introduced a new problem specific to the Chrome browser. When reloading a URL that contains an anchor in Chrome, the scroll position is set to the top of the page, ignoring the anchor. Note that this only happens when reloading a page with an anchor link, not when clicking the anchor link in the first place.

      It seems like the problem is caused by Chrome using a different sequence of firing the popstate event during page load. The solution is likely to avoid setting the scroll state during page load when the current page URL contains an anchor.

      Attachments

        Activity

          People

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: