question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
p45markcommented, Nov 20, 2019

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 to 9999 resolved it

3reactions
claudericcommented, Nov 20, 2019

Yeah, as mentioned by @p45mark this is often a z-index issue. If you find that is the case, try applying a higher z-index value on the sortable clone using the helperClass prop.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found