React-Carousel: Ensure listeners get unmounted and handle controlled drag
Previous Behavior
- Carousel attached listeners to the target document
- Carousel listeners were not being removed on unmount
- Carousel drag events were not firing correctly when index was controlled, and index changed multple times in a single drag event
New Behavior
- Carousel attaches listeners to the container node itself, reducing listener surface
- Carousel now correctly removes listeners on unmount
- Carousel now correctly waits to disable 'drag' state until carousel 'settles', this ensures that drag events are always captured in controlled index scenarios - this may cause some additional indexing events to fire, however these are technically correct as until 'settled' a drag is considered in-progress.
Related Issue(s)