Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to scroll up to see everything after returning back to home page #385

Open
catch-21 opened this issue Feb 26, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@catch-21
Copy link

catch-21 commented Feb 26, 2021

Description

If navigating away from the home page and then returning using the Back button then the home page doesn't render correctly.

Steps to reproduce

  • Navigate to https://explorer.cardano.org
  • Click on any link (e.g. "Show more" button or an Epoch number)
  • Once new page has loaded press browser's Back button

Actual Result

Home page doesn't render correctly. Only "Latest Blocks" is displayed fully, "Latest Epochs" is faded and the search bar cannot be scrolled up to. Need to refresh to load correctly. See screenshot below. (If unable to reproduce first time try refreshing on home page and try again, always happens for me after refresh)

image

Desired Result

Home page always displays the same regardless of how it is navigated to.

Environment

Linux Mint 20 (Ulyana)
Brave browser - Version 1.20.108 Chromium: 88.0.4324.182 (Official Build) (64-bit)
and
Firefox 86.0 (64-bit)

@catch-21 catch-21 added the bug Something isn't working label Mar 2, 2021
@smnhgn
Copy link
Contributor

smnhgn commented Mar 21, 2021

I had a look into this bug and here is what I found:

Currently the static html for root locale paths (e.g. "https://explorer.cardano.org/en") is generated without trailing slashes, which means ​the resulting html for "/en" is "en.html" and not "en/index.html". So if a user navigates to "/en" the url is replaced with "/en.html".

For some reason the navigation through browser back does not load "en.html" directly but goes through source/pages/_app.tsx first and uses "en.html" as locale pageProp. Due to the fact that "en.html" is not a supported locale the page is displayed with the ErrorPage Layout.

I haven't tested it yet, but it might be possible to add exceptions for root locale paths in "exportPathMap" of next.config.js.
If the static html export of root locale paths is "en/index.html" instead of "en.html" then the browser wouldn't replace "https://explorer.cardano.org/en" with "https://explorer.cardano.org/en.html".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants