Skip to content

Conversation

stowball
Copy link
Contributor

@stowball stowball commented Sep 4, 2025

…to support updating activePath with Next.js‘ usePathname.

Unlike in Pages Router, App Router's usePathname is async, so it doesn't update the activePath before updating the nav item and allowing the onClick to close the menu.

This changes it so every link click closes the menu immediately. The experience of the previous implementation basically waited for the new page to load and then the menu closed, so you looked at the same state for a second before anything happened. Now, you know something happens straight away as the menu closes, but then you have to wait for the new content to load. You can add your own loading indicator if you want to give more feedback.

View preview

Checklist

Preflight

  • Prefix the PR title with the slug of the package or component - e.g. accordion: Updated padding or docs: Updated header links
  • Describe the changes clearly in the PR description
  • Read and check your code before tagging someone for review
  • Create a changeset file by running yarn changeset. Learn more about change management.

Testing

  • Manually test component in various modern browsers at various sizes (use Browserstack)
  • Manually test component in various devices (phone, tablet, desktop)
  • Manually test component using a keyboard
  • Manually test component using a screen reader
  • Manually tested in dark mode
  • Component meets Web Content Accessibility Guidelines (WCAG) 2.1 standards
  • Add any necessary unit tests (HTML validation, snapshots etc)
  • Run yarn test to ensure tests are passing. If required, run yarn test -u to update any generated snapshots.

Copy link

changeset-bot bot commented Sep 4, 2025

🦋 Changeset detected

Latest commit: 2ac50df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ag.ds-next/react Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

sonarqubecloud bot commented Sep 4, 2025

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.

1 participant