SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.51k stars 263 forks source link

Table: MultiSelect -> None mode change does not deselect items #4194

Closed piterPro closed 2 years ago

piterPro commented 2 years ago

Describe the bug When using Table in 'MultiSelect' mode, after selecting items and changing to mode 'None', the items are still visually selected.

Isolated Example https://codesandbox.io/s/cranky-platform-gq4kz

To Reproduce Steps to reproduce the behavior:

  1. Go to sandbox
  2. Click on checkbox to select all items in the table. Items become selected, visually indicated by color change
  3. Click on button 'Change mode' to change into mode 'None'
  4. Items selected previously are still selected with change in color

Expected behavior Expect after mode change to None all selected items in previous MultiSelect mode to be deselected.

UI5 Web Components for React Information @ui5/webcomponents version: rc.15, "@ui5/webcomponents-fiori": "latest" - rc.15, @ui5/webcomponents-react version: "latest" - 0.18.11, Operating System: Windows 10 Browser: Chrome

Additional context In documentation page behavior is as expected. If you have any suggestion how we can make this happen, let me know Cheers, Petar

Lukas742 commented 2 years ago

Hi @piterPro

you could programatically reset the state of the selectedRows: codeSandbox

Still, I'm going to forward this issue to our UI5 Web Components Colleagues as the Table is developed in their repository and I'm not sure if the internal selected state should be reset when the table changes mode to "None".

MapTo0 commented 2 years ago

Dear @piterPro

We would prefer to leave the behaviour as it is. You can reset the selection as @Lukas742 proposed.

Regards, Martin