tech-docs-gem icon indicating copy to clipboard operation
tech-docs-gem copied to clipboard

In page navigation sets 'replaceState' too often which breaks in Safari

Open thomasleese opened this issue 7 years ago • 3 comments

I'm sorry I can't provide more detail in this card, but I wanted to outline two experiences I've found with the in page navigation.

For example, if you go to https://govukpay-docs.cloudapps.digital/ and scroll around for a few minutes, you'll notice that after a while it stops highlighting the sidebar following where the user currently is in the page. I'm unable to find the root cause of this or reproduce it every time, the only common thing seems to be that it stops working after a while. I don't know if this is related, but I get this in the console:

screen shot 2017-09-06 at 10 34 51

Secondly, we had a problem in https://github.com/alphagov/govuk-content-api-docs where by when you navigation to the reference page, it starts by highlighting the 'python' sidebar item even if you are at the top of the page. We've since disabled in page navigation in https://github.com/alphagov/govuk-content-api-docs/commit/ed0d92626b798984ad21987300fe59f974de787f but if you go to any commit before that you should see the problem. This could be related to the fact that the heading for 'Python' is hidden inside a <details> HTML element. Interestingly, this seems to cause the first problem I listed above to occur even more often.

thomasleese avatar Sep 06 '17 09:09 thomasleese

Interesting - what browser are you seeing those security errors in?

36degrees avatar Sep 06 '17 09:09 36degrees

Those messages are in Safari, haven't tested in other browsers.

thomasleese avatar Sep 06 '17 09:09 thomasleese

Just a note that I've retested this in October 2021 and it still appears to be an issue in Safari - I received the same errors in the Safari console.

m-green avatar Oct 27 '21 08:10 m-green