fluentui
fluentui copied to clipboard
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)
- Fixes #34658
📊 Bundle size report
| Package & Exports | Baseline (minified/GZIP) | PR | Change |
|---|---|---|---|
| react-components react-components: entire library |
1.264 MB317.961 kB |
1.264 MB317.952 kB |
-116 B -9 B |
Unchanged fixtures
| Package & Exports | Size (minified/GZIP) |
|---|---|
| react-components react-components: Button, FluentProvider & webLightTheme |
69.779 kB20.273 kB |
| react-components react-components: Accordion, Button, FluentProvider, Image, Menu, Popover |
227.642 kB65.909 kB |
| react-components react-components: FluentProvider & webLightTheme |
44.613 kB14.641 kB |
| react-portal-compat PortalCompatProvider |
8.386 kB2.624 kB |
| react-timepicker-compat TimePicker |
110.646 kB36.578 kB |
Pull request demo site: URL
