adopted-ember-addons / adopted-ember-addons/emberx-file-input

`files(e)` logic seems to be incorrect for testing

Open
#59 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
50
Forks
14
PR merge metrics
No merged PRs in 30d

Description

The [`files(e)`](https://github.com/thefrontside/emberx-file-input/blob/master/addon/components/x-file-input.js#L59-L67) conditional appears to be in the wrong order for testing because `e.target.files` will be an empty `FileList` which is truthy so the `testingFiles` branches are never reached.

I changed the behaviour in an override component to the following which is working fine for me but I may have missed something:

```
files(e) {
return (e.originalEvent || e).testingFiles || e.target.files;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.