Git Product home page Git Product logo

react-scroll-wheel-handler's People

Contributors

atakanermis avatar centrual avatar dependabot[bot] avatar enflow-io avatar etto91 avatar wlevchenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-scroll-wheel-handler's Issues

Is it possible to add momentum scrolling?

Hi,

First of all thanks for this library, so far it's been a lifesaver. What i trying to solve is if I can add momentum scrolling using the mouse wheel or trackpad. So when the user uses are larger scroll move it will go faster and slowly loses speed afterwards. The same as regular osx trackpad scrolling works.

When using the default wheel event, it will trigger way too much events which will crash the browser. React scroll wheel fixes this, but we lose the ability to use some normalized momentum scrolling. Is this something you think is possible ? And is in the scope of this library?

I'm also looking at https://idiotwu.github.io/smooth-scrollbar/ , the problem there is that it will add transforms to scroll the container, but I'm only looking to handle the events and trigger my own up/down functions.

Typescript support

I've just tried this package, it works fine! good job.

I had to add to my file global.d.ts the string declare module 'react-scroll-wheel-handler';
would be fine if you add the @type module

Wheel event doesn't work on Windows

Hi,

Thank you for this package, it works great en MacOS, but I recently noticed that it does not work on Windows. The wheel event does not fire up or down handler.

Any idea why ?

Thanks again

Scroll handler not consistently triggered

I implement the handler in an overflow hidden view and use scrolling handler to trigger animation change of component. I wrapped whole view with the handler component.

However, the handler is triggered not consistently, usually stopped working after first scroll action. Any idea on what's happening?

handler callbacks not returning the event value and focus issue

Hi @Etto91 , great work on this helpful utility component.

I noticed that when using keyboard arrow keys, the event isn't returned and is only available when scrolling (refer to image)

first log was from scrolling
2nd one was from arrow keys

image

Also another thing to point out is that whenever I'm already focusing on components outside your utility (somewhere on the yellowed section) and pressing the arrow keys, the event still being fired when the expected behavior is shouldn't because I'm no longer focusing on the scrolling section (which is on the left section).

image

I checked the code and found the potential lines why it's happening, cloned it locally and it seems it's working as expected after doing the necessary changes. I tried submitting a PR but seems like I can't push my code into your repo under different branch name, haven't tried submitting PR before anyways.

Custom Component

Hello! is there a full example to how use a Custom Component ?
Thanks~

prevent scroll is not working in mobile

I tried this package. I used the prevent scroll attribute. It is working fine in desktop but when i am trying in my mobile I was able to scroll. It is not supported in mobile?

e.preventDefault() causes warning

Passive events can not use e.preventDefault(). Browser throws a warning:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See

Nesting handlers stops stopPropagation by default.

Hi,

I have noticed that the events from nested handlers are not reaching handlers above them. This should not be the default behaviour and the user should stop it intentionally via e.stopPropagation.

I have a use case where i want a nested handler to only handle scrolling down and scrolling up should be handled by the root handler. Is it possible to achieve this ?

Allow user to decide which device this package works with

This seems to be working well overall. Thanks!

However, it'd be good if I could decide whether I want the upHandler to only apply to scrolling and not to the up arrow key nor an 'up' swipe, for instance.

It's kind of breaking for me.

I guess this is a feature request.

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.