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

TreeTable: Bug when clicked in custom action button with selectionMode="single". #5522

Closed
GabriellDatacamp opened this issue Dec 4, 2023 · 1 comment
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior

Comments

@GabriellDatacamp
Copy link
Contributor

GabriellDatacamp commented Dec 4, 2023

Describe the bug

In a TreeTable component, when the props selectionMode and onSelectionChangecallback function, clicking directly on the icon in the custom button column, triggers the onSelectionChange function. If both function open modals, it could pose a problem, and for users, it may not provide a positive experience.

(This is similar a #5074 issue)

2023-12-04.17-13-21.mp4

Reproducer

https://codesandbox.io/p/sandbox/primereact-demo-forked-xkddq5?file=%2Fsrc%2FApp.tsx

PrimeReact version

10.2.1

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

When clicked directly on the icon of a button, call just the onClick function of this button.

@GabriellDatacamp GabriellDatacamp added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 4, 2023
@melloware
Copy link
Member

I just fixed it in your code. You need your buttons to not propagate the click: https://codesandbox.io/p/sandbox/primereact-demo-forked-q4t2sz

@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
@melloware melloware added Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: By Design The behavior in the issue is by design and the component exhibits the expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants