Skip to content

Conversation

ChanDarong
Copy link

@ChanDarong ChanDarong commented Sep 8, 2025

This pull request updates the logic for checking if a URL is active in the urlIsActive utility function to provide more accurate matching, especially for root and subpath URLs.

Navigation logic improvements:

  • Updated the urlIsActive function in resources/js/lib/utils.ts to ensure that the root path '/' only matches itself, and that non-root paths match if the current URL starts with the checked URL. This provides more intuitive active link highlighting for navigation.
  • Usefull for the nav bar, because we want to keep the nav bar active in many route in a CRUD, example /admin/users, /admin/users/create, /admin/users/1/edit, etc.

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