jasonslyvia / jasonslyvia/react-anything-sortable

Sort stop working when combining map and fixed items

Open
#86 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
457
Forks
82
PR merge metrics
No merged PRs in 30d

Description

Hey there,

As referenced [in this issue](https://github.com/jasonslyvia/react-anything-sortable/issues/26#issuecomment-260233940), displaying sortable items using `map` and adding a fixed items result in the component breaking.

As stated, this can be easily replicated in the demo by replacing the map render with :

```jsx


Add 1 element

{this.state.arr.map(renderItem, this)}
Hello


```

Any help here would be really appreciated!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the demo's dynamic example and reproduce the failure using the shown Sortable markup, where mapped items are followed by a fixed span. Trace how the component handles these children during sorting; done means the mapped and fixed items render and sort without breaking.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.