You're back on the Event page, but the scroll is not restored: you have to scroll down again to continue where you had stop
Expected behaviour
The scroll is at the position of the event and not reset to the top
How to solve?
The reset to the top is due to the SearchField, which has an autofocus prop. This prop focuses the field so that we can directly type in it, but it also scroll to this field to show the field (in which you are typing).
Note that the autofocus is disabled on mobile (we should keep that).
To solve it, use React Router to know if when you open the page you have clicked on a link or if you use the go back button. Then, update the autofocus prop accordingly to have the value true when opening from on a link on desktop, and false when using the go back button (or on mobile).
How to reproduce
Expected behaviour
The scroll is at the position of the event and not reset to the top
How to solve?
The reset to the top is due to the SearchField, which has an
autofocus
prop. This prop focuses the field so that we can directly type in it, but it also scroll to this field to show the field (in which you are typing).Note that the autofocus is disabled on mobile (we should keep that).
To solve it, use React Router to know if when you open the page you have clicked on a link or if you use the go back button. Then, update the autofocus prop accordingly to have the value
true
when opening from on a link on desktop, andfalse
when using the go back button (or on mobile).