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: 解决 useLongPress 在桌面端 Safari 不兼容的问题 #2602

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

mscststs
Copy link
Contributor

@mscststs mscststs commented Jul 16, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

Ref: https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
由于 safari 桌面端不支持 TouchEvent,导致使用 moveThreshold 的情况下产生 ReferenceError 抛错。
image

解决方案:优先判断 TouchEvent 是否存在再做 instanceof 判定

📝 更新日志

语言 更新描述
🇺🇸 英文 Fix useLongPress to be compatible with Safari desktop
🇨🇳 中文 解决 useLongPress 在 safari 桌面端不生效的问题

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

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

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

@CLAassistant
Copy link

CLAassistant commented Jul 16, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ mscststs
❌ crazylxr
You have signed the CLA already but the status is still pending? Let us recheck it.

@mscststs mscststs changed the title fix: 解决 useLongPress桌面端 Safari 不兼容 TouchEvent 的问题 fix: 解决 useLongPress 在桌面端 Safari 不兼容的问题 Jul 16, 2024
Copy link
Collaborator

@crazylxr crazylxr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crazylxr crazylxr merged commit 3bd1925 into alibaba:master Jul 18, 2024
5 of 6 checks passed
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