alphagov / tech-docs-gem

Gem to distribute the tech docs project
https://tdt-documentation.london.cloudapps.digital/
MIT License
15 stars 38 forks source link

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

Open thomasleese opened 7 years ago

thomasleese commented 7 years ago

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.

36degrees commented 7 years ago

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

thomasleese commented 7 years ago

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

m-green commented 2 years ago

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.