question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

blocking on scroll doesn't seem to work

See original GitHub issue

Describe the bug When scrolling on mobile I cannot get the swipe to block.

To Reproduce Here’s my code:

`

        <SwipeableList>

          <SwipeableListItem
            threshold={0.2}
            style={{ marginTop: "0px" }}
            swipeLeft={{
              content: <span style={{ fontSize: "3em" }}>😍</span>,
            }}
            swipeRight={{
              content: <span style={{ fontSize: "3em" }}>😒</span>,
            }}
          >

            <div>

              <Text> hello</Text>

            </div>

          </SwipeableListItem>

          <SwipeableListItem
            threshold={0.2}
            style={{ marginTop: "0px" }}
            swipeLeft={{
              content: <span style={{ fontSize: "3em" }}>😍</span>,
            }}
            swipeRight={{
              content: <span style={{ fontSize: "3em" }}>😒</span>,
            }}
          >

            <div>

              <Text> hello</Text>

            </div>

          </SwipeableListItem>
          </SwipeableList>

`

I expected to block swiping when scrolling up or down. The blockSwipe prop on SwipeableListItem does work though.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
marekrozmuscommented, Oct 22, 2019

@MarkTension we have released new version, the branch from my previous comment does not exist anymore so please just use npm install @sandstreamdev/react-swipeable-list to install.

And you can set threshold on SwipeableList component, no need to do this separately for each SwipeableListItem.

1reaction
marekrozmuscommented, Oct 22, 2019

We blocked only within list component. Now you can enter element for which scrolling is blocked. Please check following branch:

npm install git://github.com/sandstreamdev/react-swipeable-list.git#fix_for_issues_36

and then in code add prop for SwipeableList

<SwipeableList scrollElement={window}>

Let me know if it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blocking scroll in a popin modal - Stack Overflow
I am working on a CMP implementation. ... Any tips about how to block the scroll behind? ... I tried that, but it...
Read more >
How to prevent overflow scrolling in CSS - LogRocket Blog
The scroll value of the overflow property adds horizontal and vertical scroll bars so you can adjust or scroll the content if it's...
Read more >
Hammer blocking scroll · Issue #10541 · angular ... - GitHub
Current behavior. If I listen for a hammer.js event on an element, it blocks vertical scrolling. Expected/desired behavior.
Read more >
Mouse wheel scrolling does not work for elements such as div ...
Mouse wheel scrolling does not work for elements such as div using overflow - auto or scroll.
Read more >
Pop-up doesn't display, can't scroll - WordPress.org
1) If you used the CSS fix, it got wiped out for some reason. Maybe when you upgraded WordPress, upgraded or changed your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found