Skip to content

onClick not working #887

@psm-solution-group

Description

@psm-solution-group

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>
  );
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions