-
-
Notifications
You must be signed in to change notification settings - Fork 50.2k
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: Input click should get focus #21413
Conversation
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.
Could you please add tests to make sure this change works as expected?
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@@ -273,6 +273,7 @@ class Input extends React.Component<InputProps, InputState> { | |||
ref={this.saveClearableInput} | |||
direction={direction} | |||
focused={focused} | |||
triggerFocus={this.focus} |
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.
应该命名 onFocus 比较好
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.
这个是外侧 span
触发 onMouseUp
后,调用 input focus
。它本身不是 onFocus
事件,特地区分开的。
Codecov Report
@@ Coverage Diff @@
## master #21413 +/- ##
=======================================
Coverage 97.83% 97.83%
=======================================
Files 302 302
Lines 7017 7017
Branches 1924 1936 +12
=======================================
Hits 6865 6865
Misses 152 152
Continue to review full report at Codecov.
|
🤔 This is a ...
🔗 Related issue link
fix #21412
💡 Background and solution
📝 Changelog
prefix
/suffix
not get focused.prefix
/suffix
不会获得焦点的问题。☑️ Self Check before Merge