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(components): [input] the cursor is misplaced when type setting number #15341

Merged
merged 3 commits into from
Jan 10, 2024

Conversation

yuchiXiong
Copy link
Contributor

PR 8193 修复了 el-input-number 组件在输入中文时会出现光标向上偏移的问题。

同时 issue 6660 提到了造成这个问题的原因:

这个是原生input已知问题,number模式下在设置line-height后会使用输入法会导致光标漂移到左上角,组件对应的文档中已有tip。 后续是不是可以考虑通过padding的方式去调整高度?

……but,当 el-input 组件指定 type=number 时,el-input 渲染的同样是一个 type=number 的 input 元素,因而同样会导致该问题,不知道是不是改漏了_(:з)∠)_

Copy link

👋 @yuchiXiong, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Copy link

github-actions bot commented Jan 3, 2024

Hello @yuchiXiong, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@chenxch chenxch changed the title fix(components): [input type=number] 修复中午输入法时行高异常的问题 fix(components): [input type=number] 修复中文输入法时行高异常的问题 Jan 3, 2024
@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

🧪 Playground Preview: https://element-plus.run/?pr=15341
Please comment the example via this playground if needed.

@yuchiXiong yuchiXiong force-pushed the fix/input-type-number-line-height branch from b5325dd to 98fce76 Compare January 4, 2024 09:26
@btea
Copy link
Collaborator

btea commented Jan 5, 2024

@yuchiXiong Hello, I cannot reproduce this problem, can you provide a reproduction link?

@yuchiXiong
Copy link
Contributor Author

@yuchiXiong Hello, I cannot reproduce this problem, can you provide a reproduction link?

in this playground

step:

  1. use Chinese Input Method
  2. Input any letter
  3. now you can see a candidate word list with Input Method
  4. select a any word
  5. now, input line-height is incorrect
image

@btea btea changed the title fix(components): [input type=number] 修复中文输入法时行高异常的问题 fix(components): [input] the cursor is misplaced when type setting number Jan 5, 2024
@dadaguai-git
Copy link

这个版本什么时候能修复呢 有点急

Copy link
Member

@kooriookami kooriookami left a comment

Choose a reason for hiding this comment

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

先这样吧

@btea
Copy link
Collaborator

btea commented Jan 10, 2024

@yuchiXiong Thanks!

@btea btea merged commit 2c851a3 into element-plus:dev Jan 10, 2024
8 checks passed
@btea
Copy link
Collaborator

btea commented Jan 10, 2024

@dadaguai-git A version will be released in the near future, but if you are in a hurry, it is recommended to add styles to fix it yourself.

@dadaguai-git
Copy link

@dadaguai-git A version will be released in the near future, but if you are in a hurry, it is recommended to add styles to fix it yourself.

好的谢谢

@element-bot element-bot mentioned this pull request Jan 10, 2024
3 tasks
@yuchiXiong yuchiXiong deleted the fix/input-type-number-line-height branch January 11, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants