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

text,label组件上的onLongPress不生效 #15256

Closed
zhaoguoweiLLHC opened this issue Feb 22, 2024 · 0 comments · Fixed by #15265 or #15361
Closed

text,label组件上的onLongPress不生效 #15256

zhaoguoweiLLHC opened this issue Feb 22, 2024 · 0 comments · Fixed by #15265 or #15361
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@zhaoguoweiLLHC
Copy link
Contributor

相关平台

微信小程序

复现仓库

https://gitlab.com/guowei2/taro-todolist.git
小程序基础库: 3.3.4
使用框架: React

复现步骤

import { View, Text, Button, Image, Label } from '@tarojs/components'
import { useLoad } from '@tarojs/taro'
import './index.scss'

export default function Index() {

  useLoad(() => {
    console.log('Page loaded.')
  })

  return (
    <View className='index'>
      <Text>Hello world!</Text>
      <View onLongPress={()=>console.log('onLongPress View')}>onLongPress View</View>
      <Text onLongPress={()=>console.log('onLongPress Text')}>onLongPress Text</Text>
      <Button onLongPress={()=>console.log('onLongPress Button')}>onLongPress Button</Button>
      <Image src='' onLongPress={()=>console.log('onLongPress Image')} />
      <Label onLongPress={()=>console.log('onLongPress Label')} >onLongPress Label</Label>
    </View>
  )
}

依次长按以上元素

期望结果

都触发onLongPress

实际结果

只有View ,Button ,Image 触发,Text Label 未触发onLongPress

环境信息

👽 Taro v3.6.23


  Taro CLI 3.6.23 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.11.1 - D:\Program Files\nodejs\node.EXE 
      npm: 10.2.4 - D:\Program Files\nodejs\npm.CMD    
    npmPackages:
      @tarojs/cli: 3.6.23 => 3.6.23 
      @tarojs/components: 3.6.23 => 3.6.23 
      @tarojs/helper: 3.6.23 => 3.6.23 
      @tarojs/plugin-framework-react: 3.6.23 => 3.6.23 
      @tarojs/plugin-platform-alipay: 3.6.23 => 3.6.23 
      @tarojs/plugin-platform-h5: 3.6.23 => 3.6.23     
      @tarojs/plugin-platform-jd: 3.6.23 => 3.6.23     
      @tarojs/plugin-platform-qq: 3.6.23 => 3.6.23     
      @tarojs/plugin-platform-swan: 3.6.23 => 3.6.23   
      @tarojs/plugin-platform-tt: 3.6.23 => 3.6.23     
      @tarojs/plugin-platform-weapp: 3.6.23 => 3.6.23  
      @tarojs/react: 3.6.23 => 3.6.23
      @tarojs/runtime: 3.6.23 => 3.6.23
      @tarojs/shared: 3.6.23 => 3.6.23
      @tarojs/taro: 3.6.23 => 3.6.23
      @tarojs/taro-loader: 3.6.23 => 3.6.23
      @tarojs/webpack5-runner: 3.6.23 => 3.6.23
      babel-preset-taro: 3.6.23 => 3.6.23
      eslint-config-taro: 3.6.23 => 3.6.23
      react: ^18.0.0 => 18.2.0
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Feb 22, 2024
TheKonka added a commit to TheKonka/taro that referenced this issue Feb 23, 2024
Chen-jj added a commit that referenced this issue Mar 6, 2024
* fix: add touchEvents to Text and Label

#15256

* test: update snapshot

---------

Co-authored-by: chenjiajian <798095202@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant