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

🐛 EES-5656 Only apply active class for navigation links if the location is matched exactly #5482

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

benoutram
Copy link
Collaborator

This PR fixes a bug on the Release order page after #5442 which renamed the Admin's 'Legacy releases' page to 'Release order'.

The 'Release order' page was updated to use the route /publication/:publicationId/releases/order instead of /publication/:publicationId/legacy by that change.

However this meant the React router's nav link for the 'Releases' page on route /publication/:publicationId/releases also had the active style applied while on the 'Release order' page since it's matching on the first part of the location.

This PR adds exact to RouterNavLinmk in NavLink so that the active class/style is only be applied if the location is matched exactly.

Before:

image

After:

image

I checked to make sure I couldn't see any problems where NavLink is used but if any arise we could consider passing exact as a prop to control the value.

Thanks to @amyb-hiveit who pointed me in the direction of the fix. 🙂

@benoutram benoutram added the bug Something isn't working label Dec 20, 2024
@benoutram benoutram force-pushed the EES-5656_ReleaseOrder_NavLink_Change branch from 8848a40 to 0804b06 Compare December 20, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant