Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to swap images between 2 divs #287

Open
sagarpadia17 opened this issue Oct 25, 2023 · 1 comment
Open

I want to swap images between 2 divs #287

sagarpadia17 opened this issue Oct 25, 2023 · 1 comment

Comments

@sagarpadia17
Copy link

sagarpadia17 commented Oct 25, 2023

  • [<ReactSortable
  •       list={list}
    
  •       setList={setList}
    
  •       ghostClass="dropArea"
    
  •       filter=".ignore-elements"
    
  •       draggable=".item"
    
  •       handle=".dragHandle"
    
  •       preventOnFilter={true}
    
  •       animation="200"
    
  •       easing="ease-out"
    
  •       swap
    
  •       onEnd={(evt) => handleSwap(evt.oldIndex, evt.newIndex)}
    
  •     >
    
  •       {list.map((key) => (
    
  •         <div key={key.id} className="item">
    
  •           <div className="col-12 py-2 ignore-elements">
    
  •             <div className="col-12">
    
  •               <div className="car-images-canvas-label d-flex align-items-center justify-content-end">
    
  •                 <p className="m-0 pe-3 ">{key.label}</p>
    
  •               </div>
    
  •             </div>
    
  •           </div>
    
  •           <div className="col-12  py-3 px-4 d-flex">
    
  •             <div className="ignore-elements">
    
  •               <img
    
  •                 src={key.demoImg}
    
  •                 className="me-3 "
    
  •                 alt={`${key.demoImg}Icon`}
    
  •                 height={150}
    
  •                 width={150}
    
  •               />
    
  •             </div>
    
  •             <div className="dragHandle">
    
  •               <img
    
  •                 src={key.actualImg}
    
  •                 className="ms-3"
    
  •                 alt={`${key.demoImg}Icon`}
    
  •                 height={150}
    
  •                 width={150}
    
  •               />
    
  •             </div>
    
  •           </div>
    
  •         </div>
    
  •       ))}
    
  •     `</ReactSortable>`]
    
  •     In this i want to add swapping functions to the actualimg but when i am adding item to actual image its not working
    
@fedmich
Copy link

fedmich commented Jan 27, 2024

You may have already solved your issue at this time, is it?

If yes, I think you can just close this issue.
or I suggest you post this in Stackoverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants