infor-design / enterprise-ng

Angular wrappers for IDS Enterprise components
Apache License 2.0
55 stars 82 forks source link

Datagrid: Parent Row selection behaviour in treegrid is inconsistent with select all checkbox behaviour #1729

Open sami1riaz opened 6 days ago

sami1riaz commented 6 days ago

Describe the bug When you select a child row in a tree grid, the parent row's selection checkbox displays a hyphen indicating partial selection or indeterminate state. Clicking on the parent row's selection checkbox selects all child rows first. Clicking on it again will deselect all child rows. This behaviour is inconsistent with the select all checkbox as it deselects all the first time you click on it while it is in the indeterminate state.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://ids-quick-start-1761-jtfalv.stackblitz.io
  2. Click on at least one but not all child rows of a parent row -> Both Select All checkbox and Parent Row show a hyphen (indicating partial selection of child rows)
  3. Click on parent row's select checkbox
  4. Result: All child rows are selected.
  5. De-select all child rows and repeat step 2
  6. Click select all checkbox
  7. Result: All child rows are de-selected.

Expected behavior The behaviour should be consistent between parent select checkbox and select all checkbox. Either deselect all or select all checkbox after clicking on a checkbox indicating partial selection (or indeterminate state )

Version

Screenshots image

Platform

Additional context stackblitz: https://ids-quick-start-1761-jtfalv.stackblitz.io

tmcconechy commented 6 days ago

Right now the stackblitz doesnt load so cant check this. But do note we have some settings:

https://main-enterprise.demo.design.infor.com/components/datagrid/test-tree-multiselect-no-children.html

https://main-enterprise.demo.design.infor.com/components/datagrid/test-tree-dont-select-children.html

https://main-enterprise.demo.design.infor.com/components/datagrid/test-tree-multiselect.html

Maybe something around that?

sami1riaz commented 6 days ago

hmm even I can't access that link. Adding the editor URL: https://stackblitz.com/edit/ids-quick-start-1761-jtfalv?file=src%2Fapp%2Fapp.component.ts

sami1riaz commented 6 days ago

https://main-enterprise.demo.design.infor.com/components/datagrid/test-tree-multiselect.html this example reproduces the issue.

The other two don't select children so they don't apply to my scenario

tmcconechy commented 6 days ago

@sami1riaz ok i see what you mean now on https://main-enterprise.demo.design.infor.com/components/datagrid/test-tree-multiselect.html

All you have to do is click twice to deselect all. The first click we chose to select all the second will deselect all.

I do not think we can change this behavior at this point

sami1riaz commented 6 days ago

@tmcconechy that is not the issue, the issue is that this behaviour is not consistent with the select all checkbox. If I have to click twice to deselect all for the parent row, I should have to do the same for the select all checkbox as well. ( the select all checkbox deselects on the first click right now)

I've updated the description of this issue a bit, hope that helps.

tmcconechy commented 6 days ago

@sami1riaz ok maybe you have a point with the other one. Will review when we can