Skip to content

Commit

Permalink
fix(onClickOutside): fix handler type
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Jul 19, 2022
1 parent 42fd0ae commit 9b934d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/onClickOutside/index.ts
Expand Up @@ -33,7 +33,7 @@ export interface OnClickOutsideOptions extends ConfigurableWindow {
*/
export function onClickOutside<T extends OnClickOutsideOptions>(
target: MaybeElementRef,
handler: <E = T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent>(evt: E) => void,
handler: (evt: T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) => void,
options: T = {} as T,
) {
const { window = defaultWindow, ignore, capture = true, detectIframe = false } = options
Expand Down Expand Up @@ -84,7 +84,7 @@ export function onClickOutside<T extends OnClickOutsideOptions>(
document.activeElement?.tagName === 'IFRAME'
&& !el?.contains(document.activeElement)
)
handler(event)
handler(event as any)
}),
].filter(Boolean) as Fn[]

Expand Down

0 comments on commit 9b934d1

Please sign in to comment.