GithubHelp home page GithubHelp logo

Comments (8)

Norserium avatar Norserium commented on May 30, 2024 1

I've reproduced it. Alas, it's a pretty tough situation.

When you, for example, click on an element I don't know will you scroll the container or not. It depends on your further interactions. So I should prevent default behavior (i.e. click), because scrolling should not be messed with clicks and other interactions.

Me need to investigate how to solve this problem. I see two pretty optimal solutions now:

  1. Add input tag to ignoreElements prop. It will disable scrolling for elements with tag input (feel free to set any selector here).
  2. Add custom handler in onClick prop:
handler(event) {
   if (event.target.focus) {
       event.target.focus();
   } else {
       event.target.click();
   }
}

Maybe I should make the second approach default for all clicks, that don't initiate scroll. But me need time to decide.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

Hello, @messcall! What's the version of the package do you use?

from react-indiana-drag-scroll.

acarkaan avatar acarkaan commented on May 30, 2024

[email protected]

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

Could you provide sandbox that reproduces your problem? I can't reproduce it (my sandbox).

from react-indiana-drag-scroll.

acarkaan avatar acarkaan commented on May 30, 2024

ı use ScrollContainer like at your sandbox code,
ı think that some css codes ı have wrote, reasons this problem.if ı solve,ı will notify here.

from react-indiana-drag-scroll.

acarkaan avatar acarkaan commented on May 30, 2024

thanks for ur help u have shown

from react-indiana-drag-scroll.

acarkaan avatar acarkaan commented on May 30, 2024

.... => ... ignoreElements={Input} .... => solved problem...

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

I close this issue now. Maybe in the future I will return to this issue, but I don't want to make this library more complicated right now.

from react-indiana-drag-scroll.

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.