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(ColorPicker): fix slider mouse move behavior bug #3042

Merged
merged 2 commits into from
Aug 9, 2024
Merged

fix(ColorPicker): fix slider mouse move behavior bug #3042

merged 2 commits into from
Aug 9, 2024

Conversation

Jippp
Copy link
Contributor

@Jippp Jippp commented Aug 8, 2024

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

#3041

💡 需求背景和解决方案

📝 更新日志

  • fix(ColorPicker): 修复 slider 部分在鼠标移入移出的缺陷

  • 本条 PR 不需要纳入 Changelog

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

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

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

Copy link
Contributor

github-actions bot commented Aug 8, 2024

完成

@HaixingOoO
Copy link
Collaborator

我觉得不用加多个mouseLeave的事件,现在mouseUp事件不生效是因为作用的elementcolor-pickerslider,可以给mouseUp作用的事件改成document就好了

@Jippp
Copy link
Contributor Author

Jippp commented Aug 8, 2024

我觉得不用加多个mouseLeave的事件,现在mouseUp事件不生效是因为作用的elementcolor-pickerslider,可以给mouseUp作用的事件改成document就好了

不太好吧,直接在document上绑定mouseUp的话,有让slider上的thumb产生瞬移的效果,比如mousedown时鼠标移出slider外面,在外面触发mouseupthumb按钮就会有瞬移的效果。

@HaixingOoO
Copy link
Collaborator

我觉得不用加多个mouseLeave的事件,现在mouseUp事件不生效是因为作用的elementcolor-pickerslider,可以给mouseUp作用的事件改成document就好了

不太好吧,直接在document上绑定mouseUp的话,有让slider上的thumb产生瞬移的效果,比如mousedown时鼠标移出slider外面,在外面触发mouseupthumb按钮就会有瞬移的效果。

现在你这判断拖拽的x是否一致来判断是否移出来判断mouseUp,但也可能鼠标移出了,实际用户并没鼠标抬起🤔

@HaixingOoO
Copy link
Collaborator

不太好吧,直接在document上绑定mouseUp的话,有让slider上的thumb产生瞬移的效果,比如mousedown时鼠标移出slider外面,在外面触发mouseupthumb按钮就会有瞬移的效果。

闪现过去那就是moseMove现在是element,改成document会好很多

@Jippp
Copy link
Contributor Author

Jippp commented Aug 8, 2024

不太好吧,直接在document上绑定mouseUp的话,有让slider上的thumb产生瞬移的效果,比如mousedown时鼠标移出slider外面,在外面触发mouseupthumb按钮就会有瞬移的效果。

闪现过去那就是moseMove现在是element,改成document会好很多

mousemove和mouseup都绑定到document上,确定好很多了😄

@uyarn uyarn changed the title fix: color-picker-panel slider鼠标move缺陷 fix(ColorPicker): fix slider mouse move behavior bug Aug 9, 2024
@uyarn uyarn merged commit 037202d into Tencent:develop Aug 9, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Aug 22, 2024
16 tasks
@Jippp Jippp deleted the fix/color-picker-panel branch August 22, 2024 08:46
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.

3 participants