Skip to content

Commit

Permalink
feat(@clayui/modal): does not close Modal when document click event i…
Browse files Browse the repository at this point in the history
…s prevented
  • Loading branch information
matuzalemsteles committed Oct 10, 2019
1 parent e346a51 commit 91c1c16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/clay-modal/src/Hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ const useUserInteractions = (
};

const handleDocumentClick = (event: Event) => {
if (event.defaultPrevented) {
return;
}

if (
elementRef.current &&
event.target !== null &&
Expand Down

0 comments on commit 91c1c16

Please sign in to comment.