Skip to content

Image组件手机端不支持滑动 #6465

@momo2019

Description

@momo2019
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.14

Environment

手机浏览器

Reproduction link

https://antdv.com/components/image-cn#API

Steps to reproduce

点开查看图片,拖动图片,失效

What is expected?

希望手机端能支持拖动

What is actually happening?

手机端无法拖动


拉了源码自己改了一下,修改vc-image/src/Preview.tsx文件
在mouseMove,mouseDown,mouseUp的位置添加了touchMove,touchStart,touchEnd事件监听。
然后对touchEvent处理了一下,使用touches下的pageX,pageY。
注意touchEnd没有touches,要做undefined判断。

希望官方有时间能兼容一下

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions