Skip to content

taro, weapp - ImagePreview组件设置 showMenuByLongpress后,双指放大缩小时会长按菜单的操作会同时被唤起 。 #3525

Description

@IsaacHo

NutUI React 包名

@nutui/nutui-react

NutUI React 版本号

3.0.20

平台

weapp

重现链接

https://codesandbox.io/p/devbox/fancy-currying-gjl874?workspaceId=ws_AtGykcDVvrbmHorvbTi7jY

重现步骤

设置showMenuByLongpress后,在真机上,双指进行放大缩小图片时,会被自动唤起长按的小程序菜单。

期望的结果是什么?

设置showMenuByLongpress后,在真机上,双指进行放大缩小图片时,不会自动弹起长按的小程序菜单,长按图片才唤起小程序菜单。

实际的结果是什么?

设置showMenuByLongpress后,在真机上,双指进行放大缩小图片时,会被自动唤起长按的小程序菜单。

环境信息

PS G:\nutui> taro info
👽 Taro v4.2.1

Taro CLI 4.2.1 environment info:
System:
OS: Windows 11 10.0.26200
Binaries:
Node: 24.13.0 - G:\github\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.12.2 - C:\Users\Administrator\AppData\Roaming\npm\npm.CMD
npmPackages:
@tarojs/cli: 4.2.1 => 4.2.1
@tarojs/components: 4.2.1 => 4.2.1
@tarojs/helper: 4.2.1 => 4.2.1
@tarojs/plugin-framework-react: 4.2.1 => 4.2.1
@tarojs/plugin-html: 4.2.1 => 4.2.1
@tarojs/plugin-platform-alipay: 4.2.1 => 4.2.1
@tarojs/plugin-platform-h5: 4.2.1 => 4.2.1
@tarojs/plugin-platform-jd: 4.2.1 => 4.2.1
@tarojs/plugin-platform-qq: 4.2.1 => 4.2.1
@tarojs/plugin-platform-swan: 4.2.1 => 4.2.1
@tarojs/plugin-platform-tt: 4.2.1 => 4.2.1
@tarojs/plugin-platform-weapp: 4.2.1 => 4.2.1
@tarojs/react: 4.2.1 => 4.2.1
@tarojs/runtime: 4.2.1 => 4.2.1
@tarojs/shared: 4.2.1 => 4.2.1
@tarojs/taro: 4.2.1 => 4.2.1
@tarojs/taro-loader: 4.2.1 => 4.2.1
@tarojs/webpack5-runner: 4.2.1 => 4.2.1
babel-preset-taro: 4.2.1 => 4.2.1
eslint-config-taro: 4.2.1 => 4.2.1
react: ^18.0.0 => 18.0.0

其他补充信息

import React, { useState } from 'react'
import { ImagePreview, Cell } from '@nutui/nutui-react-taro'

const Demo6 = () => {
const images = [
{
src: 'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
index: 1,
},
{
src: 'https://m.360buyimg.com/mobilecms/s750x366_jfs/t1/26597/30/4870/174583/5c35c5d2Ed55eedc6/50e27870c25e7a82.png',
index: 2,
},
{
src: 'https://m.360buyimg.com/mobilecms/s750x366_jfs/t1/9542/17/12873/201687/5c3c4362Ea9eb757d/60026b40a9d60d85.jpg',
index: 3,
},
{
src: 'https://m.360buyimg.com/mobilecms/s750x366_jfs/t1/30042/36/427/82951/5c3bfdabE3faf2f66/9adca782661c988c.jpg',
index: 4,
},
]

const videos = [
{
source: {
src: 'https://storage.jd.com/about/big-final.mp4?Expires=3730193075&AccessKey=3LoYX1dQWa6ZXzQl&Signature=ViMFjz%2BOkBxS%2FY1rjtUVqbopbJI%3D',
type: 'video/mp4',
},
options: {
muted: true,
controls: true,
},
index: 0,
},
{
source: {
src: 'https://storage.jd.com/about/big-final.mp4?Expires=3730193075&AccessKey=3LoYX1dQWa6ZXzQl&Signature=ViMFjz%2BOkBxS%2FY1rjtUVqbopbJI%3D',
type: 'video/mp4',
},
options: {
muted: true,
controls: true,
},
index: 5,
},
]
const [showPreview, setShowPreview] = useState(false)
return (
<>
<ImagePreview
autoPlay={false}
images={images}
videos={videos}
visible={showPreview}
showMenuByLongpress
onClose={() => setShowPreview(false)}
/>
<Cell title="视频、图片预览" onClick={() => setShowPreview(true)} />
</>
)
}
export default Demo6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions