File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ export function generateTrigger(
272272 const originChildProps = child ?. props || { } ;
273273 const cloneProps : typeof originChildProps = { } ;
274274
275- const inContainer = ( container : Element , target : Element ) => {
275+ const inContainer = ( target : Element , container : Element ) => {
276276 return (
277277 target === container ||
278278 container . contains ( target ) ||
@@ -283,13 +283,12 @@ export function generateTrigger(
283283
284284 const inPopupOrChild = useEvent ( ( ele : EventTarget ) => {
285285 const childDOM = targetEle ;
286+ const eleInContainer = inContainer . bind ( null , ele as Element ) ;
286287
287288 return (
288- inContainer ( childDOM , ele as Element ) ||
289- inContainer ( popupEle , ele as Element ) ||
290- Object . values ( subPopupElements . current ) . some ( ( subPopupEle ) =>
291- inContainer ( subPopupEle , ele as Element ) ,
292- )
289+ eleInContainer ( childDOM ) ||
290+ eleInContainer ( popupEle ) ||
291+ Object . values ( subPopupElements . current ) . some ( eleInContainer )
293292 ) ;
294293 } ) ;
295294
You can’t perform that action at this time.
0 commit comments