formly-js / vue-formly

JavaScript powered forms for Vue.js
MIT License
237 stars 33 forks source link

Model Data Types all become text when touched #37

Open andyfensham opened 6 years ago

andyfensham commented 6 years ago

All my model values becomes text the moment I start typing. So even if they came in as numbers before, and my field is an input->number, the moment I start typing, I get back text.

matt-sanders commented 6 years ago

hmm, I'll think about the best way to implement this. Potentially could be solved by just using the model.number directive but that would have to be built into whatever formly library you're using... Open to suggestions here, on whether we make this declared on the form schema, or the templates...

andyfensham commented 6 years ago

In the angular-formly one it keeps it as it receives it. As the strength in formly is to get json form structure back from a backend server, I think model.number will limit the flexibility.

matt-sanders commented 6 years ago

OK, I'll have to think about the best way to implement this as we're currently just using the v-model directive from Vue so we might have to have an in-between that keeps things as the same type. Probably not something that will be fixed straight away as my availability to work on this at the moment is a bit limited.