ng-zorro-antd
ng-zorro-antd copied to clipboard
feat(module:anchor): url fragment change on click - nzReplace
PR Checklist
Please check if your PR fulfills the following requirements:
- [✔] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
- [✔] Tests for the changes have been added (for bug fixes / features)
- [✔] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
[ ] Bugfix
[✔] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:
What is the current behavior?
- Unlike Ant's Anchor, click on an anchor's link does'nt update the fragment of the current URL.
- We lack the
replace
option that Ant provides.
What is the new behavior?
- In contrast to the Ant's Anchor, the URL fragment now updates accordingly when an anchor link is activated.
- The addition of nzReplace provides an option that, when enabled, replaces the current history state without adding a new state to the browser's history stack.
Does this PR introduce a breaking change?
[ ] Yes
[✔] No
Other information
This preview will be available after the AzureCI is passed.
Codecov Report
Attention: Patch coverage is 96.61972%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 91.53%. Comparing base (
6ec38a2
) to head (7b9723c
). Report is 68 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #8464 +/- ##
==========================================
+ Coverage 91.51% 91.53% +0.02%
==========================================
Files 535 536 +1
Lines 18424 18446 +22
Branches 2814 2818 +4
==========================================
+ Hits 16860 16884 +24
+ Misses 1245 1241 -4
- Partials 319 321 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
unit tests failed with error, please solve this issue first @ParsaArvanehPA
anchor property (nzChange) should emit nzChange when scrolling to the anchor