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

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

Closed
yeeli opened this issue Feb 15, 2024 · 1 comment
Closed

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

yeeli opened this issue Feb 15, 2024 · 1 comment
Assignees

Comments

@yeeli
Copy link

yeeli commented Feb 15, 2024

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants