adopted-ember-addons / adopted-ember-addons/ember-paper

paper-input file type doesn't call onChange method

Aperta
#453 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
879
Fork
327
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When `paper-input type = "file"` the onChange method is never called.

```
#template.hbs
{{paper-input
type="file"
files=files
onChange=(action (mut files))
}}
{{#paper-button onClick=(action 'submit')}}submit{{/paper-button}}

#controller.js
actions: {
submit() {
console.log(this.get('files'));
}
}

```

Below are some conversations about this issue: (from slack #e-paper)

> **shoxter [12:06 PM]**
> In order to support files, it looks like we need to add `onchange` to the HTML input and link it to `passThru` for the user to handle if they want to use `file` inputs.
>
> **miguelcobain [5:09 PM]**
> use an `onchange={{action "onChange"}}` in paper-input template, just like we do for `oninput`
> inside that action, test if `this.get('type') === 'file'`
> and if `textarea` is false

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.