clauderic / clauderic/react-sortable-hoc

While sorting, the item being sorted is invisible, unlike the example

Open
#630 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

I am struggling to figure out why the item is invisible while dragging. My items are images with `crossOrigin="Anonymous"`. In the examples, when you drag item, it becomes slightly translucent but not invisible. how can i have the same behavior in my example? should i switch to ul/li instead of div's, or what?

*side note: i discover `index` prop is not passed to render, so i have to pass my own variable called `i`*

```js
const SortableItem = SortableElement(({ctx,value,index,i}) => {
// index prop is not passed!!!
console.log(ctx,value,i);
//debugger;
return(


{i+1}


ctx.getImageLightness(e,i)} />
ctx.btn[i]=ref} onClick={()=>ctx.removeItem(i)}>Delete

)
});
```

```js
const SortableList = SortableContainer(({ctx,items}) => {
return (


{items.map((value, index) => (

))}

);
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the example's drag behavior with the provided SortableItem implementation, especially the crossOrigin image and drag state. Inspect how SortableElement handles the dragged item and verify whether the image remains visible and translucent rather than disappearing; the issue is done when the behavior matches the example for these image items.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.