Skip to content

Incorrect use of 'this' keyword in drag/drop file handler #137

@alexjlockwood

Description

@alexjlockwood

See this line:

 fileReader.onabort = function(e) {
   this.setState_(State.NONE);
   alert('File read cancelled');
 };

Calling this.setState_ won't work because you are using the function keyword instead of an arrow function.

Just wanted to point this out in case you ever copy/paste this code into a different project.

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