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(radio): radio-group variant="default-filled" 初始状态不应该执行动画 #3726 #3765

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

loganylwu
Copy link
Contributor

@loganylwu loganylwu commented Dec 19, 2023

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • feat(RadioGroup): 优化组件样式体验,variantdefault-filled时初始状态不执行动画

  • 本条 PR 不需要纳入 Changelog

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

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

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

@loganylwu
Copy link
Contributor Author

修复背景:
用户要求加载默认值的情况下,需要禁用动画效果
思路如下:
观察到动画效果来自于绝对定位的偏移动画,最开始top,left默认为0,0, 后续挂载元素后又根据高宽计算得到位置,再将top,left更为79px,30px(例如)。动画由此产生。
由于最开始一定要给一个元素的top,left,所以top,left的偏移不可避免,那么换个思路只需要首次修改top,left时禁用动画即可,而后续动画依然要能够正常显示(毕竟用户只要求禁止首次动画😁)。所以设计了计算top,left的disableAnimation参数来控制动画的显示和恢复。

# Conflicts:
#	test/unit/snap/__snapshots__/ssr.test.js.snap
Copy link
Contributor

完成

@uyarn uyarn merged commit 3694984 into Tencent:develop Dec 20, 2023
5 checks passed
@loganylwu loganylwu deleted the fix/radio_group_animation branch December 21, 2023 02:28
@github-actions github-actions bot mentioned this pull request Dec 21, 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.

2 participants