Skip to content

Commit

Permalink
Don't close modal when clicking on the overlay (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
robknight authored Oct 31, 2024
1 parent 04efd9b commit e1a97f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-coats-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@parcnet-js/app-connector": patch
---

Don't close the modal when clicking outside it
11 changes: 0 additions & 11 deletions packages/app-connector/src/adapters/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ export function connect(
dialog.style.maxWidth = "600px";
dialog.style.height = "90vh";
dialog.classList.add("parcnet-dialog");
dialog.addEventListener("click", (e) => {
const dialogDimensions = dialog.getBoundingClientRect();
if (
e.clientX < dialogDimensions.left ||
e.clientX > dialogDimensions.right ||
e.clientY < dialogDimensions.top ||
e.clientY > dialogDimensions.bottom
) {
dialog.close();
}
});

dialog.addEventListener("close", (ev: Event) => {
if ((ev.target as HTMLDialogElement)?.returnValue !== "REMOTELY_CLOSED") {
Expand Down

0 comments on commit e1a97f3

Please sign in to comment.