We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to check if the modal is saved before the user exit the modal also when they click outside the modal.
Is it possible to add a prop e.g. validateOnOutsideMouseClick: ()=>bool or onOutsideMouseClick: ()=> void
validateOnOutsideMouseClick: ()=>bool
onOutsideMouseClick: ()=> void
const handleOutsideMouseClick = useCallback((e: MouseEvent): void => { const containsTarget = (target: HTMLElRef) => target.current.contains(e.target as HTMLElement) if (containsTarget(portal) || (e as any).button !== 0 || !open.current || containsTarget(targetEl)) return const isValid = validateOnOutsideMouseClick && typeof validateOnOutsideMouseClick === 'function' ? validateOnOutsideMouseClick() : true; if (closeOnOutsideClick && isValid) closePortal(e) }, [isServer, closePortal, closeOnOutsideClick, portal])
const handleOutsideMouseClick = useCallback((e: MouseEvent): void => { const containsTarget = (target: HTMLElRef) => target.current.contains(e.target as HTMLElement) if (containsTarget(portal) || (e as any).button !== 0 || !open.current || containsTarget(targetEl)) return if (onOutsideMouseClick) onOutsideMouseClick(); if (closeOnOutsideClick) closePortal(e) }, [isServer, closePortal, closeOnOutsideClick, portal])
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to check if the modal is saved before the user exit the modal also when they click outside the modal.
Is it possible to add a prop e.g.
validateOnOutsideMouseClick: ()=>bool
oronOutsideMouseClick: ()=> void
The text was updated successfully, but these errors were encountered: