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: preserve caret position🐛 #23633

Merged
merged 5 commits into from
Apr 27, 2020
Merged

Conversation

huntdream
Copy link
Contributor

@huntdream huntdream commented Apr 26, 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 #23524
ref: #15173

💡 Background and solution

The caret in Password component will move to the start position of text after change display mode

📝 Changelog

Language Changelog
🇺🇸 English fix Password caret position
🇨🇳 Chinese 修复Password组件输入光标位置

☑️ 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
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Apr 26, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 26, 2020

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.

Latest deployment of this branch, based on commit 47c841f:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Apr 26, 2020

Codecov Report

Merging #23633 into master will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23633      +/-   ##
==========================================
- Coverage   98.50%   98.46%   -0.05%     
==========================================
  Files         363      363              
  Lines        7209     7211       +2     
  Branches     2000     1952      -48     
==========================================
- Hits         7101     7100       -1     
- Misses        108      111       +3     
Impacted Files Coverage Δ
components/input/Password.tsx 97.50% <100.00%> (+0.13%) ⬆️
components/_util/openAnimation.tsx 85.71% <0.00%> (-10.72%) ⬇️

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 dabec4c...47c841f. Read the comment docs.

@yoyo837 yoyo837 changed the title 🐛 fix: preserve caret position fix: 🐛 preserve caret position Apr 27, 2020
@yoyo837 yoyo837 changed the title fix: 🐛 preserve caret position fix: preserve caret position🐛 Apr 27, 2020
@yoyo837
Copy link
Contributor

yoyo837 commented Apr 27, 2020

能加一个test case 判断下光标在不在原位置吗?

@huntdream
Copy link
Contributor Author

能加一个test case 判断下光标在不在原位置吗?

没有再另外写一个test case,在should keep focus state里面状态变换前后添加了判断
(之前没怎么写过测试,不知道这样对不对 😂 )

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.

Input.Password点击显示密码input焦点问题
4 participants