Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[firefox] Numeric component has browser validation error if not specifying step="any" #317

Closed
Vaerum opened this issue Jan 12, 2017 · 3 comments
Milestone

Comments

@Vaerum
Copy link
Contributor

Vaerum commented Jan 12, 2017

Hi
I have found out that the Firefox browser make a validation error (a red border around the input field) when using the numeric component with steps. It is only visual. Chrome is all good.

Tom describe the issue here: https://www.isotoma.com/blog/2012/03/02/html5-input-typenumber-and-decimalsfloats-in-chrome/

It can be fixed by adding the tag step="any" in the numeric component. Like this:

<template>
  <div class="q-numeric textfield row inline items-center" :class="{disabled: disable, readonly: readonly}">
    <i @click="__setByOffset(-1)">remove</i>
    <input
      class="no-style auto q-input-field"
      type="number"
      v-model.number="model"
      @blur="__updateValue()"
      @keydown.enter="__updateValue()"
      @keydown.up="__setByOffset(1)"
      @keydown.down="__setByOffset(-1)"
      @keydown.esc="model = value"
      :disabled="disable"
      :readonly="readonly"
      :style="{width: (''+model).length * .7 + 'em'}"
      step="any"
    >
    <i v-show="value !== model && model !== ''">check</i>
    <i @click="__setByOffset(1)">add</i>
  </div>
</template>

// Rasmus

@rstoenescu
Copy link
Member

Thanks for reporting this and also supplying a solution!
Care for a PR? Things would go much faster.

@Vaerum
Copy link
Contributor Author

Vaerum commented Jan 12, 2017

Done

@rstoenescu rstoenescu added this to the v0.12.1 milestone Jan 12, 2017
@rstoenescu
Copy link
Member

rstoenescu commented Jan 12, 2017

Thanks for the PR! Fix available in edge version and in future v0.12.1 (very soon).

@rstoenescu rstoenescu changed the title Numeric component with minor bug (only Firefox) [firefox] Numeric component has browser validation error if not specifying step="any" Jan 12, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants