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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: If there is an existing debounce in progress, cancel that #16081

Merged
merged 1 commit into from Apr 15, 2019

Conversation

@raybooysen
Copy link
Contributor

@raybooysen raybooysen commented Apr 15, 2019

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

馃懟 What's the background?

When you have a Spin component and componentDidUpdate is called, any existing debounce() call is not cancelled.

馃挕 Solution

On every time we debounce, check and cancel if appropriate.

馃摑 Changelog

  • English Changelog: Spin component cancels debounce calls between update calls
  • Chinese Changelog (optional):

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed
@@ -116,6 +120,7 @@ class Spin extends React.Component<SpinProps, SpinState> {
debouncifyUpdateSpinning = (props?: SpinProps) => {
const { delay } = props || this.props;
if (delay) {
this.cancelExistingSpin();
Copy link
Contributor Author

@raybooysen raybooysen Apr 15, 2019

Unsure if this should be outside the if and cancelled in all cases. Can someone advise?

@raybooysen
Copy link
Contributor Author

@raybooysen raybooysen commented Apr 15, 2019

Fixes #15623

@netlify
Copy link

@netlify netlify bot commented Apr 15, 2019

Deploy preview for ant-design ready!

Built with commit fe1617b

https://deploy-preview-16081--ant-design.netlify.com

An enterprise-class UI design language and React-based implementation with a set of high-quality React components, one of best React UI library for enterprises

@codecov
Copy link

@codecov codecov bot commented Apr 15, 2019

Codecov Report

Merging #16081 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16081      +/-   ##
==========================================
+ Coverage   95.13%   95.18%   +0.04%     
==========================================
  Files         251      251              
  Lines        6722     6725       +3     
  Branches     1957     1957              
==========================================
+ Hits         6395     6401       +6     
+ Misses        326      323       -3     
  Partials        1        1
Impacted Files Coverage 螖
components/spin/index.tsx 95% <100%> (+0.26%) 猬嗭笍
components/_util/wave.tsx 88.46% <0%> (+2.88%) 猬嗭笍

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 d9d189e...fe1617b. Read the comment docs.

1 similar comment
@codecov
Copy link

@codecov codecov bot commented Apr 15, 2019

Codecov Report

Merging #16081 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16081      +/-   ##
==========================================
+ Coverage   95.13%   95.18%   +0.04%     
==========================================
  Files         251      251              
  Lines        6722     6725       +3     
  Branches     1957     1957              
==========================================
+ Hits         6395     6401       +6     
+ Misses        326      323       -3     
  Partials        1        1
Impacted Files Coverage 螖
components/spin/index.tsx 95% <100%> (+0.26%) 猬嗭笍
components/_util/wave.tsx 88.46% <0%> (+2.88%) 猬嗭笍

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 d9d189e...fe1617b. Read the comment docs.

@afc163 afc163 changed the title If there is an existing debounce in progress, cancel that fix: If there is an existing debounce in progress, cancel that Apr 15, 2019
@afc163 afc163 merged commit 321a12e into ant-design:master Apr 15, 2019
29 checks passed
@raybooysen raybooysen deleted the fix/cancelExistingDebounce branch Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants