收藏
回答

long-press-gesture-handler组件按住不放时会持续触发

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug long-press-gesture-handler 微信安卓客户端 8.0.83 3.3.0

<!--components/app/device/device-list/device-list.wxml-->

<scroll-view scroll-y="{{true}}" type="customstyle="height: calc(100vh -  {{navbarHeight}}px)">

  <grid-view type="alignedpadding="{{[20,12,20,12]}}" cross-axis-count="{{  columns}}" cross-axis-gap="16main-axis-gap="24">

    <block wx:for="{{devices}}" wx:key="id">

      <tap-gesture-handler data-index="{{index}}" worklet:ongesture="onTap">

        <long-press-gesture-handler data-index="{{index}}" tag="{{item.id}}" worklet:ongesture="onLongTap">

          <view class="app-device-itemid="{{item.id}}" data-index="{{index}}">

            <image src="../../../../static/png/pat.pngclass="app-device-item_image" />

            <view style="margin-top: 16rpx;">{{item.title}}</view>

          </view>

        </long-press-gesture-handler>

      </tap-gesture-handler>

      <!-- <view class="app-device-item" data-index="{{index}}" catch:touchend="onTouchEnd" bind:touchstart="onTouchStart">

        <image src="../../../../static/png/pat.png" class="app-device-item_image" />

        <view style="margin-top: 16rpx;">{{item.title}}</view>

      </view> -->

    </block>

    <view wx:if="{{showAdd}}" class="app-device-searchcatch:tap="onAddTap">

      <bingo-icon name="plussize="48"></bingo-icon>

    </view>

  </grid-view>

</scroll-view>


回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    02-24

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    02-24
    有用
    回复
登录 后发表内容