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

Implement optional key debouncing #899

Merged
merged 5 commits into from
Dec 21, 2020
Merged

Implement optional key debouncing #899

merged 5 commits into from
Dec 21, 2020

Conversation

Hona
Copy link
Member

@Hona Hona commented Dec 17, 2020

Closes #579

Code based on source from @Magehernan

If the parameter is not set, then there is no behaviour change, once the debounce milliseconds is set, then this will activate the changes.

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@ElderJames
Copy link
Member

Thank you for contribution @Hona

I think we could also add another flag to change value on blur.

@Hona
Copy link
Member Author

Hona commented Dec 17, 2020

@ElderJames Do you mean forcing the update without the debounce? If so then it should be done in the last commit

@ElderJames
Copy link
Member

Yes, that can preserves the behavior of the build-in InputText component. It listen the blur event instead input or keyup.

@ElderJames
Copy link
Member

Hi @Hona ,I have test the last commit, and it also would stuck at change value sometime. So I think we can only change value with blur event when DebounceMilliseconds = 0. It's the same behavior of the build-in InputText.

@codecov-io
Copy link

Codecov Report

Merging #899 (8264b2a) into master (35dc321) will increase coverage by 0.15%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #899      +/-   ##
=========================================
+ Coverage    5.40%   5.55%   +0.15%     
=========================================
  Files         400     400              
  Lines       21282   21301      +19     
=========================================
+ Hits         1150    1184      +34     
+ Misses      20132   20117      -15     
Impacted Files Coverage Δ
components/input/Input.cs 0.00% <0.00%> (ø)
components/tabs/TabPane.razor.cs 92.06% <0.00%> (+1.58%) ⬆️
components/core/Base/AntComponentBase.cs 42.30% <0.00%> (+5.12%) ⬆️
components/tabs/Tabs.razor.cs 56.32% <0.00%> (+11.83%) ⬆️

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 35dc321...8264b2a. Read the comment docs.

Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

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

Thank you!

@ElderJames ElderJames merged commit 730bd7c into ant-design-blazor:master Dec 21, 2020
ElderJames added a commit that referenced this pull request Apr 23, 2022
* Implement optional key debouncing

* Fixes & refactor

* Force update value on blur

* Only change value on blur if debounce is disabled

* fix: default to enable debounce and change value on blur directly

Co-authored-by: Luke Parker <10430890+TheRealHona@users.noreply.github.com>
Co-authored-by: ElderJames <shunjiey@hotmail.com>
ElderJames added a commit that referenced this pull request Apr 30, 2022
* Implement optional key debouncing

* Fixes & refactor

* Force update value on blur

* Only change value on blur if debounce is disabled

* fix: default to enable debounce and change value on blur directly

Co-authored-by: Luke Parker <10430890+TheRealHona@users.noreply.github.com>
Co-authored-by: ElderJames <shunjiey@hotmail.com>
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.

Performance issue - Lag when typing text quickly in text input
3 participants