Closed tvogel closed 1 year ago
Duplicate of #3924, as indicated in the issue Input type number returns string That's why .number modified exists
Ah, sorry, I misunderstood the initial reply
https://github.com/quasarframework/quasar/issues/3924#issuecomment-484625156
on the other issue that it is intended to work otherwise while I now understand it is not. Thanks!
For the record, I found that type = number
for an input type="number"
gives a "type check failed" warning in the console when the input is blank. The browser returns this value as an empty string and then Vue relays this empty string (docs: "If the value cannot be parsed with parseFloat(), then the original value is used instead").
This can be seen in a demo: https://github.com/divensky/quasar-inputs.
What happened?
When I am using a
<q-input type="number">
inside a<q-popup-edit>
in a<q-td>
, I need to specify the value to change asv-model.number="props.row.myvalue"
instead of justv-model="props.row.myvalue"
and it is not obvious why it is not enough to have the<q-input>
output a number.This may be a similar issue as https://github.com/quasarframework/quasar/issues/3924 .
Please see the codepen for trying it out.
What did you expect to happen?
I would have expected that specifying
type="number"
for the<q-input>
to be enough.Reproduction URL
https://codepen.io/eijk/pen/BaqqRLK
How to reproduce?
bad
value fromnumber
tostring
(quotes get added)Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
Firefox
Quasar info output
Relevant log output
No response
Additional context
No response