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): null/undefined routerLink should disable navigation #43087
Conversation
|
global presubmit has failures that need to be resolved. |
060a3de
to
5901045
LGTM
Just one suggestion, but otherwise 👍🏻 .
reviewed-for: public-api
ebb1e1c
to
ac7308e
The current behavior of `routerLink` for `null` and `undefined` inputs is to treat the input the same as `[]`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does _not_ behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Fixes angular#21457 Fixes angular#13980 Fixes angular#31154 BREAKING CHANGE: Previously `null` and `undefined` inputs for `routerLink` were equaivalent to empty string and there was no way to disable the link's navigation. In addition, the `href` is changed from a property `HostBinding()` to an attribute binding (`HostBinding('attr.href')`). The effect of this change is that `DebugElement.properties['href']` will now return the `href` value returned by the native element which will be the full URL rather than the internal value of the `RouterLink` `href` property.
|
started another global presubmit train after some g3 cleanup |
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
Reviewed-for: public-api
Did you consider an automated migration for this breaking change?
|
@petebacondarwin - I did. #43176 identifies and produces a warning for routerLink=“”. |
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087
|
After more migrations, started another global presubmit |
|
caretaker note: please merge and sync on its own. I've done many rounds of g3 migrations and global TAP is green, but I still think it's likely there will be failures. It would be good to have this as the only item in the sync so the breaking changes notes are easy to find and resolve. |
…43176) The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in #43087 PR Close #43176
…ngular#43176) The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat the input the same as `[]` or `''`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does not behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Migration for change in angular#43087 PR Close angular#43176
…ular#43087) The current behavior of `routerLink` for `null` and `undefined` inputs is to treat the input the same as `[]`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does _not_ behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Fixes angular#21457 Fixes angular#13980 Fixes angular#31154 BREAKING CHANGE: Previously `null` and `undefined` inputs for `routerLink` were equaivalent to empty string and there was no way to disable the link's navigation. In addition, the `href` is changed from a property `HostBinding()` to an attribute binding (`HostBinding('attr.href')`). The effect of this change is that `DebugElement.properties['href']` will now return the `href` value returned by the native element which will be the full URL rather than the internal value of the `RouterLink` `href` property. PR Close angular#43087
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ular#43087) The current behavior of `routerLink` for `null` and `undefined` inputs is to treat the input the same as `[]`. This creates several unresolvable issues with correctly disabling the links because `commands = []` does _not_ behave the same as disabling a link. Instead, it navigates to the current page, but will also clear any fragment and/or query params. The new behavior of the `routerLink` input will be to completely disable navigation for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean removing the `href` attribute. Fixes angular#21457 Fixes angular#13980 Fixes angular#31154 BREAKING CHANGE: Previously `null` and `undefined` inputs for `routerLink` were equaivalent to empty string and there was no way to disable the link's navigation. In addition, the `href` is changed from a property `HostBinding()` to an attribute binding (`HostBinding('attr.href')`). The effect of this change is that `DebugElement.properties['href']` will now return the `href` value returned by the native element which will be the full URL rather than the internal value of the `RouterLink` `href` property. PR Close angular#43087
The current behavior of
routerLinkfornullandundefinedinputs is to treatthe input the same as
[]. This creates several unresolvable issues withcorrectly disabling the links because
commands = []does not behave the sameas disabling a link. Instead, it navigates to the current page, but will also
clear any fragment and/or query params.
The new behavior of the
routerLinkinput will be to completely disable navigationfor
nullandundefinedinputs. For HTML Anchor elements, this will also meanremoving the
hrefattribute.Fixes #21457
Fixes #13980
Fixes #31154
BREAKING CHANGE:
Previously
nullandundefinedinputs forrouterLinkwereequaivalent to empty string and there was no way to disable the link's
navigation.
In addition, the
hrefis changed from a propertyHostBinding()to anattribute binding (
HostBinding('attr.href')). The effect of thischange is that
DebugElement.properties['href']will now return thehrefvalue returned by the native element which will be the full URLrather than the internal value of the
RouterLinkhrefproperty.The text was updated successfully, but these errors were encountered: