GithubHelp home page GithubHelp logo

Comments (10)

any86 avatar any86 commented on May 5, 2024

这里说的滚动是系统滚动条的滚动吗?

from any-touch.

hellohejinyu avatar hellohejinyu commented on May 5, 2024

这里说的滚动是系统滚动条的滚动吗?

是的。(你响应速度好快呀👍,我来搞个最小复现 demo 吧,方便你来解决:)

from any-touch.

any86 avatar any86 commented on May 5, 2024

好的, 感谢支持

from any-touch.

hellohejinyu avatar hellohejinyu commented on May 5, 2024

好的, 感谢支持

https://codesandbox.io/s/wizardly-bas-jriqv?file=/src/App.js

可以了,在电脑上用鼠标是可以正常滚动的,但是在手机上就不行了。感谢你写的这个手势库,非常好用。

from any-touch.

any86 avatar any86 commented on May 5, 2024

午休了, 我一会回来研究下, 然后@你

from any-touch.

any86 avatar any86 commented on May 5, 2024

可以通过关闭"阻止默认事件"来让滚动条滚动

const at = new Core(divRef.current, { preventDefault: false });

问题是未发生"swipe"之前拖拽页面, 页面会滚动不知道是不是你的预期?

我能想到的交互优化是在上下边缘放2个div(透明)用来触发swipe, 同时preventDefault: false, 这样其他部分可以用来滚动页面, 这样能满足预期?

from any-touch.

any86 avatar any86 commented on May 5, 2024

我请教你个问题, 在react中是不可以绑定自定义dom事件吗?

    <div
      ref={divRef}
      onSwipeup={setVisible(true)}
      className={cn("panel", { show: visible })}
    >

会提示没有"onSwipeup"

from any-touch.

hellohejinyu avatar hellohejinyu commented on May 5, 2024

可以通过关闭"阻止默认事件"来让滚动条滚动

const at = new Core(divRef.current, { preventDefault: false });

问题是未发生"swipe"之前拖拽页面, 页面会滚动不知道是不是你的预期?

我能想到的交互优化是在上下边缘放2个div(透明)用来触发swipe, 同时preventDefault: false, 这样其他部分可以用来滚动页面, 这样能满足预期?

我试了一下,还是决定优化一下交互,感谢及时帮我解决问题🙏

from any-touch.

hellohejinyu avatar hellohejinyu commented on May 5, 2024

我请教你个问题, 在react中是不可以绑定自定义dom事件吗?

    <div
      ref={divRef}
      onSwipeup={setVisible(true)}
      className={cn("panel", { show: visible })}
    >

会提示没有"onSwipeup"

对的,不支持在 JSX 标签中直接写的,需要拿到 dom 然后用 JS 手动去绑。

from any-touch.

any86 avatar any86 commented on May 5, 2024

我请教你个问题, 在react中是不可以绑定自定义dom事件吗?

    <div
      ref={divRef}
      onSwipeup={setVisible(true)}
      className={cn("panel", { show: visible })}
    >

会提示没有"onSwipeup"

对的,不支持在 JSX 标签中直接写的,需要拿到 dom 然后用 JS 手动去绑。

好嘞,谢谢

from any-touch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.