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.

SnapTo works only on double click

See original GitHub issue

Issue:

I am using the Notification Panel example for one of my projects. I am trying to snap the panel to the initial state when we click on the close button. This works when I double click the button but the single click is not triggering the action.

Code:

...other code
export default class App extends Component {
notif = React.createRef()
render() {
    return (
      <View style={styles.container}>
...other code
        <Interactable.View
            ref={this.notif}
            verticalOnly={true}
            snapPoints={[
              { y: 0, tension: 0, damping: 1 },
              { y: -Screen.height + 80 },
            ]}>
...other code
            <Button title="Close" onPress={() => this.notif.current.snapTo({index: 1})} ></Button>
       </Interactable.View>
     }
}
...other code

snap FYI-- I was doing double click during the last few seconds where the panel goes to correct snap.

Let me know if I am doing something wrong.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
wilau2commented, Dec 2, 2019

@cedricsandars My fix was not the right fix, it just make the clock run all the time.

I found the right fix: https://github.com/software-mansion/react-native-reanimated/issues/182#issuecomment-519632308

1reaction
cedricsandarscommented, Dec 3, 2019

@wilau2 - Thanks for helping again. Love the way how open source community works to help others even without even expecting anything in return 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn the snap to grid and snap to object options on or off in ...
To snap shapes or other objects to grid lines that go through the vertical and horizontal edges of other shapes or objects, click...
Read more >
<a> tag only working on double click and not single click
Well, first of all, this works on 2nd click, not on double click . Next,. You have attached onclick event handler in your...
Read more >
Setting Snapping Parameters - Vectorworks
Double -click a snapping tool to open the SmartCursor Settings dialog box with specific snapping parameters for that tool. Some of the tools...
Read more >
Create and work with ruler guides in InDesign - Adobe Support
Create and work with ruler guides, and use smart guides in InDesign. ... To create a spread guide without dragging, double-click a specific ......
Read more >
Mouse click sensitivity - MicroStation Forum
In other words, it seems to double click, especially when I use the middle button to snap to an end point, or if...
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