fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

React-Carousel: Ensure listeners get unmounted and handle controlled drag

Open Mitch-At-Work opened this issue 4 months ago • 2 comments

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)

  • Fixes #34658

Mitch-At-Work avatar Jun 17 '25 01:06 Mitch-At-Work