diff --git a/package.json b/package.json index 0e1ee5b..23df857 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "code-style": "npm run pret && npm run lint", "code-style:fix": "npm run pret:fix && npm run pret:fix", "build": "npm run code-style && npm run clean && rollup -c rollup.config.js --bundleConfigAsCjs", - "pub": "npm run build && npm publish", + "pub": "npm run build && npm publish --access public", "dev": "next dev -p 8888", "prepare": "husky" }, diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 14f76e4..a724977 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -6,7 +6,7 @@ export default function useOnClickOutside( ) { useEffect(() => { const listener = (event: MouseEvent | TouchEvent) => { - if (!ref.current || ref.current.contains(event.target as Node)) { + if (!ref.current || ref.current.contains(event.composedPath()[0] as Node)) { return; }