Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Fixed : Docs URL refresh when using side nav issue #9486 #9513

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

devmamunur
Copy link
Contributor

@devmamunur devmamunur commented Oct 16, 2023

Fixes Issue

Closes #9486

Changes proposed

Now, the docs side-nav link click will not refresh the full page. All docs pages will load without refreshing the URL.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Video

BioDrop.-.connect.to.your.audience.with.a.single.link.mp4

Copy link
Contributor

@amandamartin-dev amandamartin-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Gitpod works as expected. This fix is also what is recommended for working with Next from headless UI github issue convo. Looks good to me, thanks for the contribution

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw from the docs they recommend using as, interested to know people's thoughts?

@amandamartin-dev
Copy link
Contributor

I saw from the docs they recommend using as, interested to know people's thoughts?

Yes, using "as" recommended and what we had previously, but if you look further this issue is common when using the next framework and in such case is recommended to use a Link component

In reading through the Github Issue here Refresh Issue

is how I came to the conclusion that this fix is needed and appropriate in this case as it seems to be an issue within the Headless UI components.

wdyt? perhaps I missed something?

@devmamunur devmamunur closed this Oct 21, 2023
@devmamunur devmamunur reopened this Oct 21, 2023
@devmamunur
Copy link
Contributor Author

devmamunur commented Oct 21, 2023

Hi, @eddiejaoude and @amandamartin-dev

I made a new solution to fix this issue. We can use headless UI as For that we need to do a small hack. we can prevent this issue using a custom function when clicking the link we need to use preventDefault(), then push the link. It works perfectly.
step one
step-2

@eddiejaoude
Copy link
Member

small hack

Thank you for looking at alternative solutions, but I don't like the idea of a "small hack" 🤔

@amandamartin-dev
Copy link
Contributor

I saw from the docs they recommend using as, interested to know people's thoughts?

Yes, using "as" recommended and what we had previously, but if you look further this issue is common when using the next framework and in such case is recommended to use a Link component

In reading through the Github Issue here Refresh Issue

is how I came to the conclusion that this fix is needed and appropriate in this case as it seems to be an issue within the Headless UI components.

wdyt? perhaps I missed something?

@eddiejaoude bumping my original comment about the initial version of this in the PR since this has been open for a bit now (not the update with the "small hack"). Take a look and lmk what you think

@eddiejaoude
Copy link
Member

eddiejaoude commented Nov 17, 2023

Thank you for reminding me Amanda 👍

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great collaboration 💪

@eddiejaoude eddiejaoude merged commit 81dde4e into EddieHubCommunity:main Nov 17, 2023
25 checks passed
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue linked Pull Request has issue linked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Docs URL refresh when using side nav
3 participants