Skip to content

Commit

Permalink
fix: content lists drag and drop matching id's'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszrondio committed Dec 31, 2019
1 parent eadb050 commit fff00ae
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 fff00ae

Please sign in to comment.