Skip to content

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

@kevin-song-reisys

Description

@kevin-song-reisys

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions