Skip to content
This repository was archived by the owner on Jun 5, 2022. It is now read-only.
This repository was archived by the owner on Jun 5, 2022. It is now read-only.

Eliminate invalid callbacks to onChange prop #51

Open
@donalmurtagh

Description

@donalmurtagh

In this example usage, I upload 2 files, one of which is 2.7MB and the other is 4.2MB. Notice that the onChange prop is called back multiple times. The first time it is called back, only the first uploaded file is provided in the arguments, the second time it is called back, both files are provided in the arguments, etc.

You can see evidence of this in the console output of the example above

onChange called back with files: [File(2744170)]
onChange called back with files: (2) [File(2744170), File(4199232)]

Similarly, if 3 files are uploaded, onChange is called back 3 times with 1, 2, and 3 files respectively.

We should instead callback to onChange only once, providing all successfully processed files in the arguments.

I'm pretty sure that this bug was introduced recently, probably during the last month or two. The performance on the demo website is much better. My guess is that the demo site is using an older version of the component that does not include this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions