ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

fix(module:datepicker): `clear` button not updated view

Open volvachev opened this issue 3 years ago • 4 comments

Fixes #7433.

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[x] 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?

Issue Number: #7433

Does this PR introduce a breaking change?

[ ] Yes
[x] No

volvachev avatar May 16 '22 07:05 volvachev

Codecov Report

Merging #7434 (231890d) into master (40815ad) will increase coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: Current head 231890d differs from pull request most recent head e35a516. Consider uploading reports for the commit e35a516 to get more accurate results

@@            Coverage Diff             @@
##           master    #7434      +/-   ##
==========================================
+ Coverage   91.58%   91.60%   +0.01%     
==========================================
  Files         496      487       -9     
  Lines       16418    16045     -373     
  Branches     2548     2477      -71     
==========================================
- Hits        15037    14698     -339     
+ Misses       1057     1035      -22     
+ Partials      324      312      -12     
Impacted Files Coverage Δ
components/date-picker/date-picker.component.ts 92.33% <100.00%> (-0.24%) :arrow_down:
components/core/config/config.service.ts 91.17% <0.00%> (-6.26%) :arrow_down:
components/input/input.directive.ts 93.93% <0.00%> (-3.89%) :arrow_down:
components/time-picker/time-picker.component.ts 88.75% <0.00%> (-1.90%) :arrow_down:
components/tabs/tab-nav-bar.component.ts 87.23% <0.00%> (-0.71%) :arrow_down:
components/transfer/transfer.component.ts 93.27% <0.00%> (-0.71%) :arrow_down:
components/tree-select/tree-select.component.ts 90.90% <0.00%> (-0.45%) :arrow_down:
components/input/input-group.component.ts 98.27% <0.00%> (-0.36%) :arrow_down:
components/select/select.component.ts 90.93% <0.00%> (-0.33%) :arrow_down:
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 40815ad...e35a516. Read the comment docs.

codecov[bot] avatar May 16 '22 07:05 codecov[bot]

@volvachev Could you add a unit test?

wenqi73 avatar May 16 '22 07:05 wenqi73

@volvachev Could you add a unit test?

Hi, I have written one test for this case.

volvachev avatar May 16 '22 14:05 volvachev

https://github.com/volvachev/ng-zorro-antd/blob/e35a516aa5d8b7838312cfdd71e83f09fb8ea82e/components/date-picker/date-picker.component.ts#L539 Try this.cdr.detectChanges() here.

wenqi73 avatar Jul 08 '22 08:07 wenqi73