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

Website: 🐛 code example chip to same on first page #3310

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

JulianNymark
Copy link
Contributor

@JulianNymark JulianNymark commented Oct 31, 2024

Description

The bug with the code examples still happens, but only on the first page load, when there is no fragment selected (and the current path doesn't match any of the chip paths)

Re-using the existing conditional check for selected seems to fix it for the first page as well.

Copy link

changeset-bot bot commented Oct 31, 2024

⚠️ No Changeset found

Latest commit: 14b0491

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@JulianNymark JulianNymark changed the title 🐛 code example chip to same on first page Website: 🐛 code example chip to same on first page Oct 31, 2024
Comment on lines +115 to 116
const newPath = `${router.asPath.split("#")[0]}#${id}`;
router.replace(newPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really need that const now

Suggested change
const newPath = `${router.asPath.split("#")[0]}#${id}`;
router.replace(newPath);
router.replace(`${router.asPath.split("#")[0]}#${id}`);

Copy link
Contributor

@HalvorHaugan HalvorHaugan left a comment

Choose a reason for hiding this comment

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

Oops 😇 Should have thought about this 🙈

@JulianNymark JulianNymark merged commit a9a1182 into main Oct 31, 2024
4 checks passed
@JulianNymark JulianNymark deleted the codeexamples-chip-fix branch October 31, 2024 10:50
@JulianNymark
Copy link
Contributor Author

forgot to apply the const dissolving before I hit the merge button 🙈 (I think it's fine though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants