-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Datatable context menu and selection blend #5146
Comments
@flash but can't you just use |
No, because that way it’s just add to the selection like with left click and sends no data. My latest attempt like: |
Can you create a StackBlitz reproducer so I can try it? |
Please fork the CodeSandbox project or Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days. |
right click on a row and view => everything is fine |
OK it looks like its working? I CTRL+LEFTCLICK 3 items then I right click and the ContextMenu is displayed and the 3 items remain selected? |
Yes, but on the toast where the product name should be seen nothing is appear it’s because the selectedContext state has the same items as the selectedProducts instead of change the selectedContext value it adds to the array |
oh ok let me look. |
Its fixed: https://codesandbox.io/s/primereact-demo-forked-67nzvk?file=/src/App.js Your ViewProduct was viewing an Array but thinking it was 1 item so |
Well, I would like to fully separate the left and right click. For example the first 3 rows selected with left click and when I right click on the forth row the toast should only show the fourth product name and the left click selection must keep |
Oh that is an odd UI/UX paradigm. The right click should work on the Selected rows. To me that would violate Principal Of Least Surprise when it comes to what a "user expects" to happen. |
I see. The functionallity would be like you select the necessary rows and if you would like to check one if it has to be selected the you right click on it and click view (open a modal with the product details) and if needed then you close it and select with left click |
Datatable version 9.6.2 worked as described by @Flash417. Unfortunately, as of version 10 this has stopped working. |
@melloware - I believe this should be a Bug, not an Enhancement. The behavior of the Using the sandbox you provided (https://codesandbox.io/s/primereact-demo-forked-67nzvk?file=/src/App.js), I see the following issues:
In v9.6.2, right-clicking a record always passed the right-clicked record data with the |
Switched to bug. |
The bug seems to come from
|
For those looking for a work-around until this is fixed/changed: |
Fixed with #6403 |
Describe the bug
Hi There,
My problem is that I’m using Datatable with the checkbox selection function and with contextmenu too, but when I select multiple lines with the checkbox the contextmenu selection state is populated with the row selection content.
My aim is to be able to select multiple rows with left click, but when on righ click the context menu shows an ‘open’ menu item an on click it opens up a modal with the single row details that is click with the right mouse button.
It work fine until I select multiple lines with left click and then right click on a line, because the state contain all the selected rows.
i use different state (react usestate) for the selection and onContectMenuSelection props
Reproducer
No response
PrimeReact version
10.0.4
React version
18.x
Language
ES6
Build / Runtime
Next.js
Browser(s)
Chrome
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: