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(dialog): fix Dialog children Re-render Cause input cursor error #2485

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

HaixingOoO
Copy link
Collaborator

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

fix #2484

💡 需求背景和解决方案

问题:

截屏2023-09-01 17 57 15

1.发现问题是因为在光标中间输入拼音,光标是不会跳到后面的(这里我也觉得有点怪)

2.然后发现是这里调用的函数,把props的children每次都重新渲染覆盖,导致input的value每次传进来input.value = props.value(input的value又是和props.value相等的),所以导致光标一直跳到后面

解决方案:

截屏2023-09-01 18 18 09 截屏2023-09-01 18 18 54

1.把props.children这样传入是可以解决问题的

📝 更新日志

  • fix(Dialog): 修复Dialog中引入Input组件,从Input中间输入光标会跳转到最后

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

完成

@HaixingOoO
Copy link
Collaborator Author

@uyarn issue关闭了,这个pr没合并到develop🤣🤣🤣

@uyarn uyarn merged commit c046411 into Tencent:develop Nov 2, 2023
@HaixingOoO HaixingOoO deleted the fix/dialog branch November 3, 2023 01:09
@github-actions github-actions bot mentioned this pull request Nov 15, 2023
16 tasks
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.

[Dialog&Input] Dialog中引入Input组件,从Input中间输入光标会跳转到最后
2 participants