GSA / GSA/sam-ui-elements

sam-upload-v2 don't update entire table ngOnChanges

Open
#189 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8
Forks
33
Avg merge
2d 51m
Merged PRs (30d)
65

Description

`sam-upload-v2` component in `ngOnChanges` is recreating the entire table whenever there is any change to the `uploadedFiles` input (https://github.com/GSA/sam-ui-elements/blob/master/src/ui-kit/form-controls/upload-v2/upload-v2.component.ts#L253).

When this happens, it causes a very noticeable visual refresh of the toggle switches. If a toggle switch is on, after `ngOnChanges` it will be replaced with a new switch that defaults to off, which will then animate itself turning on again.

To prevent this, could we go one level more granular in `ngOnChanges` and test whether there were any changes to each file control in the table, and only remake those that changed or were added?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.