Skip to content

Drag组件不支持支付宝小程序和抖音小程序拖动 #1945

Description

@yeeli

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.3.10

平台

alipay, tt, 其他小程序

重现链接

https://github.com/jdf2e/nutui-react/blob/next/src/packages/drag/drag.taro.tsx

重现步骤

FixedNav 悬浮导航组件的Drag不支持支付宝小程序和抖音小程序下拖拽

期望的结果是什么?

在添加Drag后, 只能全平台拖拽

实际的结果是什么?

Drag只支持微信小程序拖拽, 其它平台不能拖动

环境信息

No response

其他补充信息

查看源码后发现下面这个方法实现只支持微信,支付宝小程序实现是要在exec里编写代码, 请查看支付宝小程序
https://opendocs.alipay.com/mini/api/selector-query
https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/api/ttml/tt-create-selector-query/

    createSelectorQuery()
        .select(`.${className}`)
        .boundingClientRect((rec: any) => {
          setBoundaryState({
            top: -rec.top + top,
            left: -rec.left + left,
            bottom: windowHeight - rec.height - rec.top - bottom,
            right: screenWidth - rec.width - rec.left - right,
          })

          middleLine.current =
            screenWidth - rec.width - rec.left - (screenWidth - rec.width) / 2
        })
        .exec()

Activity

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

Metadata

Metadata

Assignees

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