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.

Use with react-beautiful-dnd

See original GitHub issue

Hi @petyosi ! Great work on the library, especially the simple auto-calculation of the rows. I am trying to implement it with react-beautiful-dnd. I haven’t been able to so far, do you see any reason why it couldn’t be implemented? Here’s a codesandbox. If you help me maybe, we could also add this as a showcase in your examples? Thanks in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
exentrichcommented, Jul 13, 2020

@itayganor It’s expected behavior. This examples doesn’t have logic for persisting a reorder. They are just bare minimal examples to show how to integrate them with react-virtuoso. Check docs of sortable-hoc or beatiful-dnd to find out how to persist reorder

4reactions
exentrichcommented, Jun 18, 2020

I did it!! Here working example https://stackblitz.com/edit/react-bdax3i

When item is dragged in react-beautiful-dnd it removed from DOM, so all items above jump and break positioning. It’s known bug https://github.com/atlassian/react-beautiful-dnd/issues/1694

We can easily fix it:

  1. In ItemContainer
<div {...etc} style={{'--data-known-size': this.props['data-known-size']+'px'}}>
  1. Anywhere else
<style dangerouslySetInnerHTML={{__html: `
  [data-known-size]:empty {
    height: var(--data-known-size)
  }
`}} />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding drag-and-drop functionality with react-beautiful-dnd
Drag-and-drop is a widely used functionality that can make your application powerful. The react-beautiful-dnd library provides all the ...
Read more >
How to Add Drag and Drop in React with ... - freeCodeCamp
React Beautiful DnD is an accessible drag and drop library from Atlassian. If you don't know of Atlassian, they're the team behind Jira....
Read more >
atlassian/react-beautiful-dnd - GitHub
react -beautiful-dnd is a higher level abstraction specifically built for lists (vertical, horizontal, movement between lists, nested lists and so on). Within ...
Read more >
react-beautiful-dnd examples - CodeSandbox
React Beautiful Dnd Examples. Learn how to use react-beautiful-dnd by viewing and forking example apps that make use of react-beautiful-dnd on CodeSandbox.
Read more >
Beautiful and Accessible Drag and Drop with react-beautiful-dnd
react -beautiful-dnd is an excellent tool for these use cases. It utilizes the render props pattern to build accessible dnd functionality into lists...
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