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:input-number): use input event instead of change event #8989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HyperLife1119
Copy link
Collaborator

@HyperLife1119 HyperLife1119 commented Jan 21, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

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?

Issue Number: #8985

What is the new behavior?

通过此 PR 修正一系列问题,并将组件行为进一步对齐 antd

  • 支持键入空字符串以将值置为 null
  • 在用户输入期间也会触发 ngModelChange
  • 在用户输入期间调用 formatter
  • 输入非法值,或超出范围的值,不会触发 ngModelChange,并在失焦时恢复到上一个合法值
  • writeValue 触发期间不会触发多余的 ngModelChange
  • 在失焦时修正数字精度

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link

zorro-bot bot commented Jan 21, 2025

This preview will be available after the AzureCI is passed.

@zorro-bot zorro-bot bot requested a review from vthinkxie January 21, 2025 11:03
@HyperLife1119 HyperLife1119 force-pushed the fix/number-input-change branch from 98f6fac to b07d22a Compare January 21, 2025 11:08
@HyperLife1119 HyperLife1119 marked this pull request as ready for review January 21, 2025 11:08
@HyperLife1119 HyperLife1119 self-assigned this Jan 21, 2025
@HyperLife1119 HyperLife1119 requested a review from Laffery January 21, 2025 11:09
@HyperLife1119 HyperLife1119 added this to the v19.1 milestone Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.95%. Comparing base (d70a768) to head (768554b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8989      +/-   ##
==========================================
+ Coverage   91.93%   91.95%   +0.02%     
==========================================
  Files         555      555              
  Lines       19708    19739      +31     
  Branches     2946     2955       +9     
==========================================
+ Hits        18118    18151      +33     
+ Misses       1263     1262       -1     
+ Partials      327      326       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Laffery Laffery left a comment

Choose a reason for hiding this comment

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

LGTM

@HyperLife1119 HyperLife1119 marked this pull request as draft January 24, 2025 08:49
@HyperLife1119 HyperLife1119 force-pushed the fix/number-input-change branch 2 times, most recently from bb5a84d to a259d47 Compare January 28, 2025 15:26
@HyperLife1119 HyperLife1119 marked this pull request as ready for review January 28, 2025 15:27
@HyperLife1119 HyperLife1119 requested a review from Laffery January 28, 2025 15:34
@HyperLife1119 HyperLife1119 force-pushed the fix/number-input-change branch from a259d47 to c50ef4f Compare January 28, 2025 15:38
@HyperLife1119 HyperLife1119 force-pushed the fix/number-input-change branch from c50ef4f to 768554b Compare January 29, 2025 04:56
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.

nz-input-number doesn't react on input, but only on change (that happens on blur)
2 participants