Range quantity plus/minus button (work in progress)
Currently compatible with desktop/Android Chrome and Firefox. Edge and IE11 are coming soon. The styles and logic are a little messy right now, and there is plenty of refactoring needed.
Here are some pros and cons for using an input range slider for a quantity widget:
Pros
When compared to using a traditional quantity widget, this is one less input, and potentially less HTML. We could have a similar setup with a fieldset, legend, and 2 buttons. I've also seen it with a readonly input.
Semantically it makes sense. We are toggling through a range with a min, max, and step. There isn't a native solution for this common UI element.
It is extremely screen reader friendly. It has keyboard access (arrows), the values are repeated with every change, and the user doesn't have to move between two separate buttons. We can also use HTML5 validation easily.
There is near perfect browser support for the range input, and the components are pretty easy to style.
The JavaScript is easy to understand and customize. This can easily be rewritten in your preferred framework.
The hover styles with a value above zero are a bit buggy. Using 2 buttons is easier to style overall.
One advantage to using 2 buttons is that we can target each button individually and use enter or space. We lose that here, because we are interacting with the range tracks.