Open atefBB opened 2 years ago
Hey just wanted to chime in since I also needed this functionality.
In case it's helpful for anyone, you can implement this using the isSelected
function on the list of default static ranges (or your own list). For example:
const onChangeHandler = (range) => {
const knownRange = defaultStaticRanges.find((x) => x.isSelected(range.selection));
if (knownRange) {
console.log(`Selected known range ${knownRange.label}`)
} else {
console.log(`Selected custom range ${range.selection}`)
}
}
@anthonynsimon nice shoot! I'll try it ! Thanks.
Types of changes
Description
Add the possibility to get
selected range label
fordefined range
component