Skip to content

fix (web components): #4487 Previous selectedRows state is maintained when the ic-data-table data prop changes - #4669

Draft
eb67758 wants to merge 3 commits into
mi6:developfrom
eb67758:fix/chnage-watch-data-for-props
Draft

fix (web components): #4487 Previous selectedRows state is maintained when the ic-data-table data prop changes#4669
eb67758 wants to merge 3 commits into
mi6:developfrom
eb67758:fix/chnage-watch-data-for-props

Conversation

@eb67758

@eb67758 eb67758 commented Sep 4, 2026

Copy link
Copy Markdown

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

  • Changes to docs package checked and committed.
  • All acceptance criteria reviewed and met.

Testing

  • Relevant unit tests and visual regression tests added.
  • Visual testing against Figma component specification completed.
  • Playground stories in React Storybook up to date, with any prop changes and additions addressed.
  • Compare performance of modified components against develop using Performance addon in React Storybook.

Accessibility

  • Accessibility Insights FastPass performed.
  • A11y unit test added and yields no issues.
  • A11y plug-in on Storybook yields no issues.
  • Manual screen reader testing performed using NVDA and VoiceOver.
  • Manual keyboard testing for keyboard controls and logical focus order.
  • Correct roles used and ARIA attributes used correctly where required.
  • Logical heading structure is maintained, and the HTML elements used for headings can be changed to fit within the wider page structure.

Resize/zoom behaviour

  • Page can be zoomed to 400% with no loss of content.
  • Screen magnifier used with no issues.
  • Text resized to 200% with no loss of content.
  • Text spacing increased as per the WCAG 1.4.12 success criterion with no loss of content.

System modes

  • Browser setting 'prefers reduced motion' tested. No animations or motion visible whilst this setting is on.
  • Windows High Contrast mode tested with no loss of content.
  • System light and dark mode tested with no loss of content.
  • Browser support tested (Chrome, Safari, Firefox and Edge).

Testing content extremes

  • Min/max content examples tested with no loss of content or overflow.
  • All prop combinations work without issue.
  • Tested for FOUC (Flash of Unstyled Content) in both SSR (Server-Side Rendering) and SSG (Static Site Generation) settings.
  • Controlled and uncontrolled input components tested.
  • Props/slots can be updated after initial render.

@github-actions
github-actions Bot changed the base branch from main to develop September 4, 2026 16:12
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Your PR was set to target main, PRs should be target develop
The base branch of this PR has been automatically changed to develop, please check that there are no merge conflicts

@CLAassistant

CLAassistant commented Sep 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eb67758
eb67758 force-pushed the fix/chnage-watch-data-for-props branch from 212336b to 63c687c Compare September 4, 2026 16:28
@evenstensberg

evenstensberg commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@eb67758 you'll need to rebase your commit to include a scope:

test(canary-web-components): yeehaw or
fix(canary-web-components): howdy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants