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(slider): fix slider click event bug #1034

Merged

Conversation

ChrisLee0211
Copy link
Contributor

@ChrisLee0211 ChrisLee0211 commented Jun 21, 2022

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

问题:Slider组件使用inputNumberProp时,点击滑动条无法把值同步到InputNumber组件
原因:InputNumber组件有个判断是否使用当下Slider上一次渲染值,但click逻辑中没有在每次完成操作后同步更新该值,并且把该值用作渲染InputNumber组件的参数
解决办法:排查发现旧版逻辑中存在prevValue属性来记录上一次的滑动值,但该值只在拖拽时被同步且被用于赋值给sliderButton的位置计算属性。经过考虑和调试,完全可以移除该值,直接以Slider的value值去替代来避免每次click滑动条导致值同步差异问题

📝 更新日志

  • fix(Slider): 修复 Slider 组件使用 inputNumberProp 时,点击滑动条无法把值同步到 InputNumber 组件问题

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

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

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

@github-actions
Copy link
Contributor

完成

@PengYYYYY PengYYYYY merged commit 416d5f8 into Tencent:develop Jun 22, 2022
@github-actions github-actions bot mentioned this pull request Jun 27, 2022
15 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.

None yet

2 participants