QInput of type 'number' with some invalid content is nullified on blur #15952
Unanswered
CamilleDrapier
asked this question in
General - Components / Directives / etc
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using a regular
<input type="number">
, it is possible to enter more or less any text and the text will show in the input field (even after blurred/unselected), then additional validations can be made, for example displaying the message "This field should be numeric".An example of this can be found there: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_number
With Quasar, we can use the "QInput" component with type "number", but this one will automatically remove/nullify the value if the value entered is not a number when the input is blurred.
An example of this can be tried there: https://quasar.dev/vue-components/input#input-of-number-type
I would like to be able to display the copied/inputted value and a validation error during/after interacting with the QInput, but I couldn't find a way to do this. Would there be a way I missed when trying things out with this component?
The only way I think this is possible would be to use a generic
input
and add some classes and siblings to make it look/behave like other fields in my form, but obviously I would prefer not to resort to this kind of difficult-to-maintain outcome.Thanks in advance for any help provided in this matter
Beta Was this translation helpful? Give feedback.
All reactions