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 7 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

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.264 MB
317.961 kB
1.264 MB
317.952 kB
-116 B
-9 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.779 kB
20.273 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
227.642 kB
65.909 kB
react-components
react-components: FluentProvider & webLightTheme
44.613 kB
14.641 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-timepicker-compat
TimePicker
110.646 kB
36.578 kB
🤖 This report was generated against d3507e2bc96148b0f91fd8b26a841d1bdab12a1a

github-actions[bot] avatar Jun 17 '25 01:06 github-actions[bot]

Pull request demo site: URL

github-actions[bot] avatar Jun 17 '25 02:06 github-actions[bot]