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): 修复 input 组件中可能会覆盖全局 placeholder 的问题 #767

Merged
merged 18 commits into from
Mar 7, 2023

Conversation

AnteeHub
Copy link
Contributor

@AnteeHub AnteeHub commented Mar 7, 2023

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#764

💡 需求背景和解决方案

问题定位

原先的编码失误会导致全局的 locale.placeholder 被覆盖,原 issue 中发现的问题根源是正确的。
image

杂项

风格优化: 在 states 之前定义 placeholder 的变量,后续直接使用引用值,集中修改,统一引用,避免可能修改了某一个 placeholder 设置值的逻辑而漏掉另一个的问题。

+  const inputPlaceholder = placeholder || locale.placeholder

- <textarea placeholder = {placeholder || locale.placeholder} />
- <input placeholder = {placeholder || locale.placeholder} />
+ <textarea placeholder = {inputPlaceholder} />
+ <input placeholder = {inputPlaceholder} />

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fock仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

@oasis-cloud oasis-cloud merged commit c7cfe87 into jdf2e:main Mar 7, 2023
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.

2 participants