Skip to content

Commit

Permalink
fix: legal notices dismisses on click anywhere (#1452)
Browse files Browse the repository at this point in the history
Modal shouldn't be nested inside the button, messes up click handling
and makes the modal dismiss on a click anywhere.
  • Loading branch information
dsmmcken authored Aug 25, 2023
1 parent 5cc2936 commit a189375
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/code-studio/src/settings/LegalNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ function LegalNotice(): ReactElement {
};

return (
<Button kind="ghost" onClick={toggle} icon={vsLaw}>
Legal Notices
<>
<Button kind="ghost" onClick={toggle} icon={vsLaw}>
Legal Notices
</Button>
<Modal isOpen={modal} toggle={toggle} className="theme-bg-light">
<ModalHeader toggle={toggle}>Legal Notice</ModalHeader>
<ModalBody>
Expand All @@ -35,7 +37,7 @@ function LegalNotice(): ReactElement {
</p>
</ModalBody>
</Modal>
</Button>
</>
);
}

Expand Down

0 comments on commit a189375

Please sign in to comment.