I’d like a slider with a tooltip that displays hours in intervals (from 10:10 to 12:00. Is there any way to do this because IonRange only accepts numbers?
The pin
feature will only display the actual value, and value
must be an integer, so you have a few options.
First, convert your time into an integer
representation, such as hours between your interval.
Then, either don’t do a floating tooltip but display the hour value below/above the range by rendering the hour value that corresponds with the integer range value.
Or, if you want to get fancy, you could listen for touchmove events on the body or perhaps on the range itself and position a tooltip yourself above the range that updates with the actual hour value.
Is there a technical limitation to having the value just being integers?
I feel like in case of an array, the range intervals could correspond to the array elements’ indexes and still show the array element in the tooltip.
There’s no technical limitation, and it certainly would make sense to support dynamic pin rendering based on the current value. Unfortunately, IonRange
doesn’t support that at the moment.