File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
packages/@headlessui-react/src/components/transitions Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28
28
- Ensure the ` Popover.Panel ` is clickable without closing the ` Popover ` ([ #1443 ] ( https://github.com/tailwindlabs/headlessui/pull/1443 ) )
29
29
- Improve "Scroll lock" scrollbar width for ` Dialog ` component ([ #1457 ] ( https://github.com/tailwindlabs/headlessui/pull/1457 ) )
30
30
- Make the ` ref ` optional in the ` Popover ` component ([ #1465 ] ( https://github.com/tailwindlabs/headlessui/pull/1465 ) )
31
+ - Ensure the ` ref ` is forwarded on the ` Transition.Child ` component ([ #1473 ] ( https://github.com/tailwindlabs/headlessui/pull/1473 ) )
31
32
32
33
## [ @headlessui/react @1.6.1] - 2022-05-03
33
34
Original file line number Diff line number Diff line change @@ -411,21 +411,21 @@ let TransitionRoot = forwardRefWithAs(function Transition<
411
411
)
412
412
} )
413
413
414
- function Child < TTag extends ElementType = typeof DEFAULT_TRANSITION_CHILD_TAG > (
415
- props : TransitionChildProps < TTag >
416
- ) {
414
+ let Child = forwardRefWithAs ( function Child <
415
+ TTag extends ElementType = typeof DEFAULT_TRANSITION_CHILD_TAG
416
+ > ( props : TransitionChildProps < TTag > , ref : MutableRefObject < HTMLElement > ) {
417
417
let hasTransitionContext = useContext ( TransitionContext ) !== null
418
418
let hasOpenClosedContext = useOpenClosed ( ) !== null
419
419
420
420
return (
421
421
< >
422
422
{ ! hasTransitionContext && hasOpenClosedContext ? (
423
- < TransitionRoot { ...props } />
423
+ < TransitionRoot ref = { ref } { ...props } />
424
424
) : (
425
- < TransitionChild { ...props } />
425
+ < TransitionChild ref = { ref } { ...props } />
426
426
) }
427
427
</ >
428
428
)
429
- }
429
+ } )
430
430
431
431
export let Transition = Object . assign ( TransitionRoot , { Child, Root : TransitionRoot } )
You can’t perform that action at this time.
0 commit comments