While sorting, the item being sorted is invisible, unlike the example
See original GitHub issueI 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
const SortableItem = SortableElement(({ctx,value,index,i}) => {
// index prop is not passed!!!
console.log(ctx,value,i);
//debugger;
return(
<div class="reorder-slide-item">
<p class="p4 item-no">{i+1}</p>
<img crossOrigin="Anonymous" src={value} alt="" onLoad={e=>ctx.getImageLightness(e,i)} />
<button class="button link item-remove" ref={ref=>ctx.btn[i]=ref} onClick={()=>ctx.removeItem(i)}>Delete</button>
</div>
)
});
const SortableList = SortableContainer(({ctx,items}) => {
return (
<div>
{items.map((value, index) => (
<SortableItem key={index} ctx={ctx} index={index} value={value} i={index} />
))}
</div>
);
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Sort one column by another column in Power BI
Learn how to change the look of a Power BI visual by sorting it by data fields. Use one column to define the...
Read more >Ultimate guide to sorting in Javascript and Typescript
Let's start with the most basic example and sort the array of strings: const words = ['Tango', 'Zulu', 'Bravo', 'Lima']; words.sort(); ...
Read more >Sorting Data in a Report | TIBCO WebFOCUS KnowledgeBase
Sorting is hierarchical, so values are first sorted by the first field in the Row or Column bucket, then by the second field,...
Read more >Simple to enter Unicode character that would sort after Z in ...
I am looking for one character that is easy to enter from the keyboard that would be sorted after "z" by most sort...
Read more >Solved: how to sort a column by other column which is not
1) no object selected on the canvas · 2) under Fields - click column you want to be sorted by another column ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this same issue when putting the sortable list in a Modal component, and when dragging the draggable item was “behind” the modal. Setting the
z-index
to9999
resolved itYeah, as mentioned by @p45mark this is often a
z-index
issue. If you find that is the case, try applying a higherz-index
value on the sortable clone using thehelperClass
prop.