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

fix(router): RouterLinkActive will always remove active classes when … #54982

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Mar 21, 2024

…links are not active

Previously, RouterLinkActive would only add or remove the active classes when its active state changed. This means that if you accidentally add one of the active classes to the static class attribute, it won't get removed until the link becomes active and then deactives (because the class is added at creation time and never removed until the RouterLinkActive state changes from active to inactive).

fixes #54978

@atscott atscott added area: router target: patch This PR is targeted for the next patch release labels Mar 21, 2024
@ngbot ngbot bot modified the milestone: Backlog Mar 21, 2024
…links are not active

Previously, `RouterLinkActive` would only add or remove the active classes when
its active state changed. This means that if you accidentally add one of
the active classes to the static class attribute, it won't get removed
until the link becomes active and then deactives (because the class is
added at creation time and never removed until the `RouterLinkActive`
state changes from active to inactive).

fixes angular#54978
Copy link
Contributor

@sonukapoor sonukapoor left a comment

Choose a reason for hiding this comment

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

LGTM

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Mar 26, 2024
@dylhunn
Copy link
Contributor

dylhunn commented Mar 27, 2024

This PR was merged into the repository by commit eae75ff.

@dylhunn dylhunn closed this in eae75ff Mar 27, 2024
dylhunn pushed a commit that referenced this pull request Mar 27, 2024
…links are not active (#54982)

Previously, `RouterLinkActive` would only add or remove the active classes when
its active state changed. This means that if you accidentally add one of
the active classes to the static class attribute, it won't get removed
until the link becomes active and then deactives (because the class is
added at creation time and never removed until the `RouterLinkActive`
state changes from active to inactive).

fixes #54978

PR Close #54982
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this pull request Apr 6, 2024
…links are not active (angular#54982)

Previously, `RouterLinkActive` would only add or remove the active classes when
its active state changed. This means that if you accidentally add one of
the active classes to the static class attribute, it won't get removed
until the link becomes active and then deactives (because the class is
added at creation time and never removed until the `RouterLinkActive`
state changes from active to inactive).

fixes angular#54978

PR Close angular#54982
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: router target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

routerLinkActive doesn´t set the active class correctly
3 participants