@@ -5,6 +5,7 @@ import type { CSSMotionProps } from 'rc-motion';
5
5
import type { DrawerPanelRef } from './DrawerPanel' ;
6
6
import DrawerPanel from './DrawerPanel' ;
7
7
import type ScrollLocker from 'rc-util/lib/Dom/scrollLocker' ;
8
+ import { composeRef } from 'rc-util/lib/ref' ;
8
9
import DrawerContext from './context' ;
9
10
import type { DrawerContextProps } from './context' ;
10
11
@@ -180,7 +181,10 @@ export default function DrawerPopup(props: DrawerPopupProps) {
180
181
// ============================ Mask ============================
181
182
const maskNode : React . ReactNode = mask && (
182
183
< CSSMotion key = "mask" { ...maskMotion } visible = { open } >
183
- { ( { className : motionMaskClassName , style : motionMaskStyle } ) => {
184
+ { (
185
+ { className : motionMaskClassName , style : motionMaskStyle } ,
186
+ maskRef ,
187
+ ) => {
184
188
return (
185
189
< div
186
190
className = { classNames (
@@ -194,6 +198,7 @@ export default function DrawerPopup(props: DrawerPopupProps) {
194
198
...zIndexStyle ,
195
199
} }
196
200
onClick = { maskClosable && onClose }
201
+ ref = { maskRef }
197
202
/>
198
203
) ;
199
204
} }
@@ -245,10 +250,10 @@ export default function DrawerPopup(props: DrawerPopupProps) {
245
250
removeOnLeave = { false }
246
251
leavedClassName = { `${ prefixCls } -content-hidden` }
247
252
>
248
- { ( { className : motionClassName , style : motionStyle } ) => {
253
+ { ( { className : motionClassName , style : motionStyle } , motionRef ) => {
249
254
return (
250
255
< DrawerPanel
251
- ref = { panelRef }
256
+ ref = { composeRef ( motionRef , panelRef ) }
252
257
prefixCls = { prefixCls }
253
258
className = { classNames ( className , motionClassName ) }
254
259
style = { {
0 commit comments