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(module:upload): do not trigger change detection for nz-upload-btn #7032

Merged

Conversation

arturovt
Copy link
Member

@arturovt arturovt commented Nov 2, 2021

PR Checklist

PR Type

What kind of change does this PR introduce?

[x] Bugfix

What is the current behavior?

Currently, it runs change detection each time the nz-upload-btn is clicked, tho it opens a native OS file picker. This is considered as a "dead" change detection (ApplicationRef.tick() is run, but there's nothing to update). This may cause a frame drop when opening a native file picker (because Angular has to run the whole change detection before opening it).

What is the new behavior?

There's no dead change detection when the nz-upload-btn is clicked.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@arturovt arturovt requested a review from cipchk as a code owner November 2, 2021 17:48
@zorro-bot
Copy link

zorro-bot bot commented Nov 2, 2021

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #7032 (15edc9e) into master (b18c050) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7032      +/-   ##
==========================================
- Coverage   89.52%   89.51%   -0.02%     
==========================================
  Files         489      489              
  Lines       15768    15774       +6     
  Branches     2573     2573              
==========================================
+ Hits        14117    14120       +3     
- Misses       1011     1012       +1     
- Partials      640      642       +2     
Impacted Files Coverage Δ
components/upload/upload-btn.component.ts 96.89% <100.00%> (+0.09%) ⬆️
components/core/util/text-measure.ts 89.47% <0.00%> (-1.76%) ⬇️
components/time-picker/time-holder.ts 95.78% <0.00%> (-1.06%) ⬇️

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 b18c050...15edc9e. Read the comment docs.

Copy link
Member

@cipchk cipchk left a comment

Choose a reason for hiding this comment

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

LGTM

@simplejason simplejason merged commit 47f91c7 into NG-ZORRO:master Nov 4, 2021
@arturovt arturovt deleted the fix/upload-btn-change-detection branch November 4, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants