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(
272
272
const originChildProps = child ?. props || { } ;
273
273
const cloneProps : typeof originChildProps = { } ;
274
274
275
- const inContainer = ( container : Element , target : Element ) => {
275
+ const inContainer = ( target : Element , container : Element ) => {
276
276
return (
277
277
target === container ||
278
278
container . contains ( target ) ||
@@ -283,13 +283,12 @@ export function generateTrigger(
283
283
284
284
const inPopupOrChild = useEvent ( ( ele : EventTarget ) => {
285
285
const childDOM = targetEle ;
286
+ const eleInContainer = inContainer . bind ( null , ele as Element ) ;
286
287
287
288
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 )
293
292
) ;
294
293
} ) ;
295
294
You can’t perform that action at this time.
0 commit comments