Skip to content

Commit

Permalink
Merge pull request #228 from tomaszrondio/2.0
Browse files Browse the repository at this point in the history
fix: content lists drag and drop matching id's'
  • Loading branch information
takeit authored Dec 31, 2019
2 parents eadb050 + fff00ae commit 2d587f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions client/components/ContentLists/Manual/Manual.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ class Manual extends React.Component {
return list;
};

getDraggableId = item =>
item.content ? item.id + "_" + item.content.id : item.id;

render() {
let filteredContentListItems = this.markDuplicates([
...this.state.list.items
Expand Down Expand Up @@ -486,7 +489,7 @@ class Manual extends React.Component {
{filteredContentListItems.map((item, index) => (
<Draggable
key={"list" + item.id}
draggableId={item.id}
draggableId={this.getDraggableId(item)}
index={index}
>
{(provided, snapshot) => (
Expand Down Expand Up @@ -560,7 +563,7 @@ class Manual extends React.Component {
{this.state.articles.items.map((item, index) => (
<Draggable
key={"article" + item.id}
draggableId={item.id}
draggableId={this.getDraggableId(item)}
index={index}
>
{(provided, snapshot) => (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"moment": "^2.24.0",
"ng-file-upload": "^12.2.13",
"ng-infinite-scroll": "^1.3.0",
"react-awesome-slider": "^1.0.1",
"react-awesome-slider": "^1.2.0",
"react-beautiful-dnd": "^11.0.5",
"react-select": "^3.0.4",
"react-virtualized-auto-sizer": "^1.0.2",
Expand Down

0 comments on commit 2d587f4

Please sign in to comment.