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

Component: TreeTable, node selection with contextMenue joint mode #14642

Closed
mbraeuner opened this issue Jan 27, 2024 · 2 comments
Closed

Component: TreeTable, node selection with contextMenue joint mode #14642

mbraeuner opened this issue Jan 27, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@mbraeuner
Copy link

mbraeuner commented Jan 27, 2024

Describe the bug

If you implement a TreeTable with multiple select, context menu and contextMenuSelectionMode joint like this:
[metaKeySelection]="false"
selectionMode="multiple"
[contextMenu]="myContextMenu"
contextMenuSelectionMode="join'"

then a right click on a not selected tree nodes will set the tree node selection to the one node with the right click, but we have joint monde.

Environment

Angular 17.0.8

Reproducer

https://stackblitz.com/edit/github-e6mmtz

Angular version

17.0.8

PrimeNG version

17.3.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v20.10.0

Browser(s)

chrome 120.0.6099.216 (Offizieller Build) (64-Bit)

Steps to reproduce the behavior

  1. click first tree node left
  2. click second tree node left
  3. click third tree node right
  4. click the context menu item
  5. inspect logs

Expected behavior

clicking a not selected tree node with joint mode should included the clicked one into the selection.
In this case the selectedNodes should keep Node 1,2 and 3

Maybe I'm wrong what the joint mode should be. If I'm not wrong the right clicked node should not reset current selection if the metaKeySelection == false

this.selection = [node];

should be

  this.selection = [...this.selection, node];

if metaKeySelection == false

@mbraeuner mbraeuner added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 27, 2024
@mbraeuner mbraeuner changed the title Component: TreeTable Component: TreeTable, node selection with contextMenue joint mode Jan 27, 2024
@mbraeuner
Copy link
Author

mbraeuner commented Jan 28, 2024

I thought about it. Best solution is, that a context menu click will not add new items. The selection should not be touched in this case.
Then a developer can decide to use current selection or the node from event depending on use case.

@mehmetcetin01140
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants