1

I was trying to disable the input spinner but all I could fine here was to hide it, like this:

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

But how can it be completely disabled ?

2 Answers 2

3

Try this:

/* For Firefox */
input[type='number'] {
    -moz-appearance:textfield;
}

/* Webkit browsers like Safari and Chrome */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

Source: https://blog.rudolphk.co.za/css-tip-remove-spinner-on-input-of-number-9fc4d9cac121

Sign up to request clarification or add additional context in comments.

2 Comments

This doesn't appear to address the question.
Apparently you did not even try the solution, because it worked for me
0

Using this Jquery you can disable it, so the mouse wheel wont change the numbers

$(':input[type=number]').on('mousewheel', function(e){
    $(this).blur(); 
});

Source: https://css-tricks.com/snippets/css/turn-off-number-input-spinners/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.