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(common/check, checkbox and radio): if the value of Checkbox or Ra… #1131

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

Blackn-L
Copy link
Contributor

…dio is empty, don't render span

when the value of Checkbox or Radio is ''、null、undefined, don't render span, avoid the Non -expected
margin

fix #1114

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

#1114

💡 需求背景和解决方案

  • 背景:CheckboxRadio,依旧会渲染内容为空的 span 元素,在某些场景会有非预期表现;
  • 解决方案:CheckboxRadio无内容时,不再渲染 span;
  • 逻辑:通过判断 label 或 children 为 空字符串nullundefined 来决定是否渲染 span;

📝 更新日志

  • fix(Checkbox、Radio): 内容为空时,不再渲染 span 元素,避免某些场景非预期的 margin;
  • 本条 PR 不需要纳入 Changelog

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

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

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

…dio is empty, don't render span

when the value of Checkbox or Radio is ''、null、undefined, don't render span, avoid the Non -expected
margin

fix Tencent#1114
@github-actions
Copy link
Contributor

失败

src/common/Check.tsx Outdated Show resolved Hide resolved
@honkinglin
Copy link
Collaborator

npm run test:update 更新下 snapshot

@Blackn-L Blackn-L requested a review from honkinglin July 19, 2022 05:17
@honkinglin honkinglin merged commit 6f3e1ad into Tencent:develop Jul 22, 2022
@honkinglin honkinglin mentioned this pull request Jul 22, 2022
16 tasks
@github-actions github-actions bot mentioned this pull request Jul 25, 2022
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
2 participants