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

onClick not working #887

Open
psm-solution-group opened this issue Jan 29, 2025 · 0 comments
Open

onClick not working #887

psm-solution-group opened this issue Jan 29, 2025 · 0 comments

Comments

@psm-solution-group
Copy link

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

1 participant