kysonic / riot-mui

Set of material ui components for riot js.
MIT License
151 stars 14 forks source link

input name in material-input should also consider opts.name #11

Closed prateekbh closed 8 years ago

prateekbh commented 8 years ago

current code is

<input type="{opts.type || 'text'}" disabled="{disabled}" placeholder="{opts.placeholder}" onkeyup="{changeValue}" value="{value}" autocomplete="off" name="input"/>

this hard codes name of input to be "input" this hard code should only be a fallback

prateekbh commented 8 years ago

@kysonic taking this up...

kysonic commented 8 years ago

@prateekbh Yes, this is a problem. A first version of material input contained solution:

... name="{opts.name}" ,

but for some reason in last version of riot.js this code has stopped to work. I've made quick fixes but i haven't resolved this problem in general.

PS. i'll check out your PR a little bit later.

kysonic commented 8 years ago

@prateekbh I've rewritten code a little bit. There were a couple of mistakes. For example i've tried to obtain an element by its name before it was ready. I've moved this code into "mount" callback and everything started to work.