fix (web components): #4487 Previous selectedRows state is maintained when the ic-data-table data prop changes - #4669
Conversation
Develop -> Main
|
Your PR was set to target |
There was a problem hiding this comment.
Welcome 👋
Welcome to the ic-ui-kit repo, thank you for submitting a pull request!
How to contribute
Please read our CONTRIBUTING.md, which explains our ways of working and guidelines for contributions.
Code of Conduct
We'd appreciate it if you could read and abide by our Code of Conduct, as we wish to foster an inclusive and respectful community.
Targeting your pull request
We use develop rather than main as the base for contributions - please make sure your PR is targeting develop.
Signing the CLA
We require all contributors to sign our Contributor License Agreement (CLA) before we can accept a contribution. If you are contributing on behalf of an organization please follow your organization's policies in signing CLAs.
Associated issue
Please make sure that your pull request has an issue open - this allows us to keep track of changes made and offer support where needed.
212336b to
63c687c
Compare
|
@eb67758 you'll need to rebase your commit to include a scope:
|
Summary of the changes
When using the selectable variant of the ic data table, changing the data prop did not reset the internal selectedRows and row counter state.
Therefore, when hitting the select all checkbox & then changing the data prop (through means such as paginating) causes the previous checked items to be maintained internally and the checkbox will stay selected, with the row counter id starting from the length of the previous data.
This PR fixes this issue, resetting the internal selectedRows and row counter state when the data prop changes.
Related issue
https://jira.tdx.gss.gov.uk/browse/FOR-3245
Checklist
General
Testing
Accessibility
Resize/zoom behaviour
System modes
Testing content extremes