-
Notifications
You must be signed in to change notification settings - Fork 41
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: trigger onChange twice when inputting using the input method #61
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #61 +/- ##
==========================================
+ Coverage 97.31% 97.34% +0.02%
==========================================
Files 5 5
Lines 186 188 +2
Branches 68 69 +1
==========================================
+ Hits 181 183 +2
Misses 5 5 ☔ View full report in Codecov by Sentry. |
src/Input.tsx
Outdated
@@ -97,6 +97,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => { | |||
| React.ChangeEvent<HTMLInputElement> | |||
| React.CompositionEvent<HTMLInputElement>, | |||
currentValue: string, | |||
fromCompositionEnd?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个最好是 info: { source: 'compositionEnd' }
src/Input.tsx
Outdated
@@ -97,6 +97,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => { | |||
| React.ChangeEvent<HTMLInputElement> | |||
| React.CompositionEvent<HTMLInputElement>, | |||
currentValue: string, | |||
fromCompositionEnd?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个最好是 info: { source: 'compositionEnd' }
Same as what #60 wants to do. Test case code writing also comes from it.
fix ant-design/ant-design#46587
close #60