Fork me on GitHub
#hoplon
<
2017-06-20
>
jouerose09:06:21

when i have (input :type "file" :multiple true ) how do i access the files selected via a :change function ?

flyboarder16:06:22

@jouerose try :change #(prn %1 %2 ) and see what that gives you

jouerose16:06:30

@flyboarder it has printed a lot of things 🙂

jouerose16:06:35

but not the file names

jouerose16:06:49

@flyboarder this is the beginning of it: #js {:originalEvent #object[Event [object Event]], :type change, :isDefaultPrevented #object[returnFalse "function returnFalse() { return false; }"], :timeStamp 19470268.76, :jQuery191042257022931828647 true, :which nil, :view nil, :target #<Element: INPUT>, :shiftKey nil, :relatedTarget nil, :metaKey false, :eventPhase 2, :currentTarget #<Element: INPUT>, :ctrlKey nil, :cancelable false, :bubbles true, :altKey nil, :delegateTarget #<Element: INPUT>, :handleObj #js {:type change, :origType change, :data nil,

flyboarder17:06:26

@jouerose you see how there is an original event, that contains a .target.files property, which is a file list.

flyboarder22:06:21

@thedavidmeister runtime specs for ya 😉 ^^^

flyboarder22:06:41

both attribute providers are fully spec’ed

flyboarder22:06:23

[hoplon "7.1.0-SNAPSHOT"]