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

  • Home
  • SEARCH
  • 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

Is there any way to style <input type=range> elements for Webkit browsers?
WebKit/Safari supports the console object, which is similar to what Firebug does. But what
Given that Chrome and Safari use webkit has anyone yet found anything that renders
I have a very strange issue that only affects webkit browsers for some reason,
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
In HTML5 there is a new input type, 'search'. On most browser it's just
Everything works fine in webkit browsers. But when i'm trying to use border-radius with
I'm running into a strange issue in WebKit browsers, where the email field on
I have an input type=range that is bigger then its parent. I want to
The simple HTML below displays differently in Firefox and WebKit-based browsers (I checked in

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.