Fix: unresponsive toggle menu after navigating back from roadmap page… - #6964
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#6861
Summary:
The toggle menu on the left, which allows users to select categories such as "All Roadmaps," "Absolute Beginners," "Web Development," and others, becomes unresponsive after navigating to a roadmap and then using the browser's back button to return to the previous page.
Details:
Upon detailed debugging, it was observed that Firefox aggressively caches certain static resources, including manifest.json and favicon.ico. Specifically, when navigating back to the /roadmaps route from other routes, Firefox attempts to load a /favicon.ico file from the root directory. However, in this project, the favicon is located inside the manifest folder:
The browser's expectation is to find the favicon at:
Due to this discrepancy, Firefox fails to load the favicon correctly, which interferes with the code execution and results in the toggle menu becoming unresponsive.
Current Solution:
To address this, a copy of the favicon has been added to the public folder. While this change is anticipated to resolve the issue, it has not yet been tested in a production build. It is believed that this adjustment will fix the problem, but further testing is necessary to confirm its effectiveness.
Alternative Solution:
If the above solution does not resolve the issue, another approach involves using the
popstate eventto dynamically reload the content on the /roadmaps route specifically for Firefox. This approach would ensure that the page content is reloaded correctly when navigating back, circumventing the caching issue.Discussion:
I am open to further discussions or alternative solutions to ensure this issue is fully resolved. Please let me know if there are any additional steps or considerations that should be addressed.
Firefox Implementation: