react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

The browser "back" button doesn't work

Open mvasin opened this issue 7 years ago • 14 comments

The browser "back" button doesn't work after clicking a fragment link (/page => /page#something).

URL changes back from /page#something to /page, but it has no effect on the scroll position.

mvasin avatar Apr 10 '18 08:04 mvasin

To be precise, after navigating from /page#something1 to /page#something2 the back button works. But if you open a /page and scroll down, then click a link that takes you to /page#something, the back button won't take you back (to the scroll position you were at).

mvasin avatar Apr 10 '18 08:04 mvasin

can i work on this?

webbdays avatar Dec 15 '22 03:12 webbdays

I am working on this!

shubhangii0324 avatar Oct 13 '23 15:10 shubhangii0324

Update: this still seems broken on the new react.dev site. It works sometimes but not all the time.

rickhanlonii avatar Jan 11 '24 16:01 rickhanlonii

If you want to fix this, please just submit a PR, no need to ask to be assigned.

rickhanlonii avatar Jan 11 '24 16:01 rickhanlonii

will try to work on this issue

trevlee0212 avatar Feb 05 '24 03:02 trevlee0212

@trevlee0212 go ahead, thanks for the help! Submit a PR when you have a working fix.

pwbriggs avatar Feb 05 '24 04:02 pwbriggs

@pwbriggs PR submitted!

trevlee0212 avatar Feb 09 '24 09:02 trevlee0212

I noticed that this issue hasn't been addressed since February. I was able to reproduce the bug and would like to work on fixing it. Has it already been resolved?

mannika763 avatar Jun 16 '24 14:06 mannika763

Also, could you provide a video description?

mannika763 avatar Jun 16 '24 14:06 mannika763

@mannika763 my PR #6614 basically provided the solution for fixing the bug. Just waiting for it to get reviewed. But feel free to contribute if you have any other (or better) solution!

trevlee0212 avatar Jun 17 '24 06:06 trevlee0212