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: Input click should get focus #21413

Merged
merged 5 commits into from
Feb 17, 2020
Merged

fix: Input click should get focus #21413

merged 5 commits into from
Feb 17, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 17, 2020

🤔 This is a ...

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

🔗 Related issue link

fix #21412

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Input click with prefix / suffix not get focused.
🇨🇳 Chinese 修复 Input 点击 prefix / suffix 不会获得焦点的问题。

☑️ 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

Copy link

@tests-checker tests-checker bot left a 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?

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Feb 17, 2020

@codesandbox-ci
Copy link

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.

@codesandbox-ci
Copy link

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}
Copy link
Member

Choose a reason for hiding this comment

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

应该命名 onFocus 比较好

Copy link
Member Author

@zombieJ zombieJ Feb 17, 2020

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
Copy link

codecov bot commented Feb 17, 2020

Codecov Report

Merging #21413 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
components/input/ClearableLabeledInput.tsx 100% <ø> (ø) ⬆️
components/input/TextArea.tsx 100% <100%> (ø) ⬆️
components/input/Input.tsx 100% <100%> (ø) ⬆️

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 a90aa25...5ac4fea. Read the comment docs.

@zombieJ zombieJ merged commit ed1959c into master Feb 17, 2020
@zombieJ zombieJ deleted the input-focus branch February 17, 2020 11:12
@pr-triage pr-triage bot added the PR: merged label Feb 17, 2020
@ycjcl868 ycjcl868 mentioned this pull request Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.0 Input will affix can not click to get focus
3 participants