Open JerichoKain opened 5 years ago
Hi, I'm working on this issue. As this will be my first contribution to the project, any guidance will be welcome :)
I also duplicated the issue here in development mode so you have use the vue dev tools to inspect: https://jerichokain.github.io/vue-material-input/ from this repo: https://github.com/JerichoKain/vue-material-input
I began to look into it a little more over the weekend, as far as I could tell the issue really is that the model is being cleared, which will trigger the label to cover the value in the input.
In src\components\MdField\MdField.vue
I think the stringValue is what is triggering the label to move, which is coming from the MdFieldMixin.js
... and here is where I got lost. I think the mixin is trying to use value and localValue to bind with the md-input and the md-field, and maybe something is getting lost there?
The thing getting lost is the value of the input itself, when we update the value of the input to a new invalid value, the input attribute value is cleared in the DOM, so is that empty value that is passed to the framework.
De: Mark Oelke notifications@github.com Enviado: quarta-feira, 10 de julho de 2019 13:57 Para: vuematerial/vue-material Cc: Franklin Oliveira Da Veiga; Manual Assunto: Re: [vuematerial/vue-material] Issues with label and md-input type="Number" (#2092)
I also duplicated the issue here in development mode so you have use the vue dev tools to inspect: https://jerichokain.github.io/vue-material-input/ from this repo: https://github.com/JerichoKain/vue-material-input
I began to look into it a little more over the weekend, as far as I could tell the issue really is that the model is being cleared, which will trigger the label to cover the value in the input.
In src\components\MdField\MdField.vue I think the stringValue is what is triggering the label to move, which is coming from the MdFieldMixin.js... and here is where I got lost. I think the mixin is trying to use value and localValue to bind with the md-input and the md-field, and maybe something is getting lost there?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/vuematerial/vue-material/issues/2092?email_source=notifications&email_token=ABADX3ILCZP2GN3H27GAMV3P6YIJBA5CNFSM4H6NWIBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZUC5OI#issuecomment-510144185, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABADX3IXX6NO2NHVCMQCIS3P6YIJBANCNFSM4H6NWIBA.
Hi, I created a pull request to solve the problem: https://github.com/vuematerial/vue-material/pull/2108
Steps to reproduce
md-field
with alabel
and<md-input v-model="num" type="Number">
.Further inspection shows that the value in the $el.value is maintained, only the v-model is not.
Which browser?
Chrome: 75 Firefox: 66 Vue: ^2.6.10 Vue Material: ^1.0.0-beta11
What is expected?
The v-model value should not be cleared and the label should not cover the input value.
What is actually happening?
The v-model is cleared and the label acts as if there are no values in the the md-field.
Reproduction Link
https://codesandbox.io/s/vue-material-quick-start-l55e4