react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

onClick not working

Open psm-solution-group opened this issue 10 months ago • 1 comments

Hello,

if I click on my Icon at sortableItem Component then nothings triggers. if I add the same comonent to sortableList it works. Why can I not onClick on sortableItem ? It is the item "IosCloseCircle".

const SortableItem = SortableElement<SortableElementProps & TDragAndDropSortableItem>(({ value, onDelete }: TDragAndDropSortableItem) => (
  <div>
    <div className="relative drag-item">
       /// HERE NOT WORKING NO TRIGGER/no console log
      <IoCloseCircle onClick={() => console.log('saas')} size={24} className="delete-button-dad" />
      <img src={value} className="dad-img" />
    </div>
  </div>
));

const SortableList = SortableContainer<SortableContainerProps & TDragAndDropSortableList<string>>(({ items, onDelete }: TDragAndDropSortableList<string>) => {
  return (
    <div className="relative" style={{ display: "flex", flexWrap: "wrap" }}>
      {items.map((value: any, index: number) => (
        <div className="relative">
          <SortableItem key={`item-${value}`} index={index} value={value} onDelete={(e) => console.log(e)} />
        </div>
      ))}
    </div>
  );
});

psm-solution-group avatar Jan 29 '25 16:01 psm-solution-group