open-ui
open-ui copied to clipboard
[invokers] stepUp and stepDown actions for number inputs
See https://github.com/openui/open-ui/pull/967 for a PR by @spookylukey
See:
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
- https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp
- https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown
The idea is that with this in place, we could easily create more visually appealing (and accessible) versions of
<input type=number>without any javascript.
For example, the number widgets in this shopping basket from https://abilitynet.org.uk/training/how-use-screen-reader-accessibility-testing?utm_source=Intro-Screen-Readers&utm_medium=Factsheet-Highlights&utm_campaign=2023-Training-Promo
It also requires some CSS to hide the native spinners - https://stackoverflow.com/questions/3790935/can-i-hide-the-html5-number-input-s-spin-box
Opening the issue to have a place to discuss and agenda+ if necessary.
I'm not against the idea I think it fits into the spirit of invokers being "declarative method invocation".
I do think it'd need some thoughts on how exactly it's mapped to aria.
I also wonder if it's potentially the wrong solution. Should we just have a standardised anatomy for <input type="number"> that allows for the visually appealing design above.