Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4337000
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:53:03+00:00 2026-05-21T10:53:03+00:00

In Webkit browsers, an input[type=number] has a spinbox control: However, Safari does not follow

  • 0

In Webkit browsers, an input[type=number] has a spinbox control:

spinbox control in webkit browsers

However, Safari does not follow some other input[type=number] rules, like enforcing that only numeric characters are entered. Hence, Modernizr detects that Safari does not support input[type=number].

I have very particular needs for number-input width, and when there’s a spinbox I make the width 2.7em and without it (like in Firefox), the width need only be 1.7em. So Chrome and Firefox both look fine. But Safari puts in a spinbox but doesn’t follow any other rules, so it gets the 1.7em width and looks like this:

number input in Safari

I only care if there’s a spinbox control. I don’t care about any of the other input[type=number] rules that Safari is flouting. Safari is playing by the only rule I care about. How do I detect that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:53:04+00:00Added an answer on May 21, 2026 at 10:53 am

    I suggest hiding the spinbox when Modernizr doesn’t detect support for number inputs:

    JS:

    if (!Modernizr.inputtypes.number) {
        $('body').addClass('no-number-input');
    }
    

    CSS:

    .no-number-input input::-webkit-outer-spin-button,
    .no-number-input input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0; 
    }
    

    If you really want to detect whether the spinbox is visible you can do something like:

    window.getComputedStyle(input, '-webkit-inner-spin-button').getPropertyValue('-webkit-appearance') != 'none'
    

    where input is a “raw” element, although this may not be very reliable, e.g. in Safari for Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem exists for webkit browsers only chrome and possibly safari (i've not tested
Is there any way to style <input type=range> elements for Webkit browsers?
i have CSS code that does not really work on webkit browsers such as
The problem only happens on input[type=text] in Webkit. No matter what I do, there
<input x-webkit-speech /> Gives in webkit browsers: Is there a way to to trigger
I'm running into a problem with WebKit browsers (Chrome 15.0.x and Safari 5.1.1) where
I have a very strange issue that only affects webkit browsers for some reason,
This is WebKit browsers specific (meaning that I only need to make it work
Would anyone now why this script is disabling my nav in webkit browsers $(document).ready(function
What is a library I can use for CSS webkit support across multiple browsers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.