Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kevin-song-reisys opened this issue Dec 17, 2018 · 1 comment
Open

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

kevin-song-reisys opened this issue Dec 17, 2018 · 1 comment

Comments

@kevin-song-reisys
Copy link
Contributor

kevin-song-reisys commented Dec 17, 2018

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?

@kevin-song-reisys
Copy link
Contributor Author

kevin-song-reisys commented Dec 17, 2018

Example:

samuploadrefresh

After confirming the modal, we trigger a change with this.uploadedFiles = this.uploadedFiles.splice(0).

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

No branches or pull requests

1 participant