GithubHelp home page GithubHelp logo

Comments (13)

Norserium avatar Norserium commented on May 30, 2024 1

I suppose, that solution above is pretty suitable for this situation. Not obvious, but not weird. But you should notice that it will not disable dragging on mobile devices.

I will think about disabled prop, but it's arguable solution, because it's not obvious what's exactly will be disabled (drag scroll, every scroll and etc.)

Перевод на русский Я думаю, решение, приведённое выше, вполне подходит для данной ситуации. Не очевидное, но и не столь костыльное. Однако следует отметить, что оно не отключит соответствующий скроллинг для мобильных устройств.

Я подумаю насчёт добавления пропа "disabled", но это достаточно спорное решение, поскольку не вполне очевидно, что именно будет отключено (скролл мышкой, любой скролл и т.д.)

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

@katalonne, it's undocumented also. But I'm glad to see someone, who want to use it. Could you describe the case?

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

@Norserium ahh.. I thought it will disable the drag...
I'm implementing a hand tool and I need to disable the drag.
Thanks for the reply.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

I'm implementing a hand tool and I need to disable the drag.

Disable drag?

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

onMouseMove

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

Sorry, but I don't understand. If it would be helpful, I know Russian also. There is high probability, that you know it too.

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

Mne inogda ne nado scroll kogda drag (cerez mouse click/mousemove), toliko na mousewheel (obychnyi).
caroce tam esti functia : isDraggable, i napisal kostyli )

(ScrollContainer.prototype as any).isDraggable = function (target: any) {
  const { ignoreElements, disableDrag } = this.props
  if (disableDrag) return false
  if (ignoreElements) {
    const closest = target.closest(ignoreElements)
    return closest === null || closest.contains(this.getElement())
  } else {
    return true
  }
}

Tipa dobavil novyi prop: disableDrag

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

The same effect you may get by adding the following prop: ignoreElements={disableDrag ? "*" : ""}. But it's pretty strange case, in the described situation I don't see the reason to use this library. It's designed to implement scroll by mouse.

Перевод на русский Аналогичный эффект можно получить добавлением пропса:
ignoreElements={disableDrag ? "*" : ""}
Но это довольно странный кейс, поскольку в описанной ситуации я не вижу смысла использовать эту библиотеку. Она предназначена для прокручивания мышкой.

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

I don't see the reason to use this library

As I said: I'm implementing a hand tool and I need to disable the drag
I have to modes, think canDrag: boolean.
If I'm wrong can you point me to other library?

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 30, 2024

What's the "hand tool"?

Перевод на русский А что за "hand tool"?

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

@Norserium https://answers.acrobatusers.com/How-I-access-hand-tool-Adobe-Reader-q151155.aspx

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

ignoreElements={disableDrag ? "*" : ""} thanks!

from react-indiana-drag-scroll.

katalonne avatar katalonne commented on May 30, 2024

what's exactly will be disabled

You can document the disabled prop as Disable drag on desktop browsers .

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.