open-ui icon indicating copy to clipboard operation
open-ui copied to clipboard

Standardise the anatomy of input[type=number]

Open lukewarlow opened this issue 2 years ago • 6 comments
trafficstars

<input type="number"> elements display spinners in most desktop browsers to increase/decrease the number value. These cannot be styled. There is the non-standard ::-webkit-inner-spin-button and ::-webkit-outer-spin-button, but these are limited and don't work in all browsers. Links regarding the webkit selectors:

https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-inner-spin-button https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-outer-spin-button https://trac.webkit.org/wiki/Styling%20Form%20Controls#inputelement

It would be good for Open UI to standardise this anatomy and then try to standardise it for better styleability.

See https://github.com/w3c/csswg-drafts/issues/8777

lukewarlow avatar Jun 14 '23 09:06 lukewarlow

This issue is mostly to bring it to this CGs attention

lukewarlow avatar Jun 14 '23 09:06 lukewarlow

Thanks @lukewarlow - any interest in driving an explainer?

gregwhitworth avatar Jul 21 '23 01:07 gregwhitworth

Yeah I'm definitely interested in helping out with that I'm gonna take some time this weekend to look through the various libraries and see what they have.

lukewarlow avatar Jul 21 '23 08:07 lukewarlow

Research PR: https://github.com/openui/open-ui/pull/784

lukewarlow avatar Jul 23 '23 14:07 lukewarlow

Another thought, and apologies if this is the wrong place to suggest this, or if it's achievable some other way: it would be useful to be able to set the width of the part of the input that's not the spinner (to make sure a certain number of digits fit), which implies it should be addressable somehow. As far as I can see, no browser currently makes this part of the control addressable.

jyasskin avatar Aug 19 '23 03:08 jyasskin

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

github-actions[bot] avatar Feb 16 '24 00:02 github-actions[bot]