react-spectrum
react-spectrum copied to clipboard
feat(rangeCalendar): allow to customise the behavior when the pointer is released outside of the component
Closes https://github.com/adobe/react-spectrum/issues/8850
Adds a new property to useRangeCalendar allowing you to specify the behavior when the pointer is released outside of the component:
select: (default) same as the current behavior, commit the hovered range dates.clear: clear the current range selection.reset: restore the previously selected range (i.e., the one selected before starting a new selection).
✅ Pull Request Checklist:
- [x] Included link to corresponding React Spectrum GitHub Issue.
- [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [x] Filled out test instructions.
- [x] Updated documentation (if it already exists for this component).
- [x] Looked at the Accessibility Practices for this feature - Aria Practices