On Firefox 28, I'm using <input type="number">
works great because it brings up the numerical keyboard on input fields which should only contain numbers.
In Firefox 29, using number inputs displays spin buttons at the right side of the field, which looks like crap in my design. I really don't need the buttons, because they are useless when you need to write something like a 6~10 digit number anyway.
Is it possible to disable this with CSS or jQuery?
In
SASS
/SCSS
style, you can write like this:Definitely this code style can use in
PostCSS
.Faced the same issue post Firefox update to 29.0.1, this is also listed out here https://bugzilla.mozilla.org/show_bug.cgi?id=947728
Solutions: They(Mozilla guys) have fixed this by introducing support for "-moz-appearance" for
<input type="number">
. You just need to have a style associated with your input field with "-moz-appearance:textfield;
".I prefer the CSS way E.g.:-
Or
You can do it inline as well:
It's worth pointing out that the default value of
-moz-appearance
on these elements isnumber-input
in Firefox.If you want to hide the spinner by default, you can set
-moz-appearance: textfield
initially, and if you want the spinner to appear on:hover
/:focus
, you can overwrite the previous styling with-moz-appearance: number-input
.I thought someone might find that helpful since I recently had to do this in attempts to improve consistency between Chrome/FF (since this is the way number inputs behave by default in Chrome).
If you want to see all the available values for
-moz-appearance
, you can find them here (mdn).According to this blog post, you need to set
-moz-appearance:textfield;
on theinput
.