@delangle/use-modal
Advanced tools
Comparing version 1.7.3 to 1.8.0
@@ -100,6 +100,9 @@ var __assign = (this && this.__assign) || function () { | ||
var handleClick = function (e) { | ||
var target = e.target; | ||
if (!configRef.current.persistent && | ||
state === ModalState.opened && | ||
domRef.current && | ||
!domRef.current.contains(e.target)) { | ||
target && | ||
!domRef.current.contains(target) && | ||
!!target.parentNode) { | ||
handleClose(); | ||
@@ -106,0 +109,0 @@ } |
@@ -101,6 +101,9 @@ 'use strict'; | ||
var handleClick = function (e) { | ||
var target = e.target; | ||
if (!configRef.current.persistent && | ||
state === exports.ModalState.opened && | ||
domRef.current && | ||
!domRef.current.contains(e.target)) { | ||
target && | ||
!domRef.current.contains(target) && | ||
!!target.parentNode) { | ||
handleClose(); | ||
@@ -107,0 +110,0 @@ } |
{ | ||
"name": "@delangle/use-modal", | ||
"version": "1.7.3", | ||
"version": "1.8.0", | ||
"description": "React hook for modal management", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -146,2 +146,4 @@ import * as React from 'react' | ||
const handleClick = (e: MouseEvent) => { | ||
const target = e.target as Node | null | ||
if ( | ||
@@ -151,3 +153,5 @@ !configRef.current.persistent && | ||
domRef.current && | ||
!domRef.current.contains(e.target as Node) | ||
target && | ||
!domRef.current.contains(target) && | ||
!!target.parentNode | ||
) { | ||
@@ -154,0 +158,0 @@ handleClose() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41419
842