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.

Gaps show in list occasionally when dragging

See original GitHub issue

Sometimes gaps show up in the list when dragging as mentioned in https://github.com/deanmcpherson/react-native-sortable-listview/issues/2

I believe the fix for the gaps is to update onPanRepsonderRelease()'s last state assignment from

this.state.active = false;
this.state.hovering = false;

to

if (this.props._legacySupport) {
  this.state.active = false;
  this.state.hovering = false;
} else {
  this.setState({
    active: false,
    hovering: false
  });
}

to match the assignment further up to trigger a refresh.

I can submit a PR but I’ve not had a chance to test this across iOS/Android versions yet.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:19

github_iconTop GitHub Comments

3reactions
kennykswancommented, May 7, 2017

@RUIFERNANDE5 I was able to solve the gap issue by modifying line 301:

let hoveringIndex = this.order[this.state.hovering] || this.state.hovering;

to:

let hoveringIndex = this.order[this.state.hovering];
0reactions
chtrinhcommented, Jan 2, 2018

@nihgwu: i haven’t validated it for iOS hence the lack of the PR. Just wanted to inform everyone about this. Not sure if everyone would like a Platform guard here. e.g.

if (Platform.OS === "android") {
  let hoveringIndex = this.order[this.state.hovering] || this.state.hovering;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

When moving a Draggable, big gap appears at the top of a list ...
Dragging from the top to the bottom gives the effect, like shown in the gif above. This also happened when dragging inside a...
Read more >
Opening a gap in NSTableView during drag and drop
I've thought of and tried a couple approaches without much success. My first thought was to double the height of the row under...
Read more >
Excel Tutorial: How to fill in empty cells using data ... - YouTube
Excel Tutorial: How to fill in empty cells using data from above, so you don't have any gaps leftIf you are looking for...
Read more >
Gap Trading: How to Play the Gap - Investopedia
Disruptions in stock patterns are known as gaps. Learn how you can earn money by analyzing these disruptions in normal price patterns.
Read more >
How to get rid of large gaps in text in MS Word - Super User
Click anywhere on the page that has the gap. · Go to "Page Layout" tab · click on the lower right corner of...
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