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

[invokers] stepUp and stepDown actions for number inputs

Open lukewarlow opened this issue 1 year ago • 1 comments

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

Screenshot 2023-12-03 at 14-15-42 How to use a screen reader for accessibility testing AbilityNet

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.

lukewarlow avatar Dec 03 '23 14:12 lukewarlow

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.

lukewarlow avatar Dec 03 '23 14:12 lukewarlow