Skip to content

Commit b57b613

Browse files
dhrumishahDun-sin
authored andcommitted
Update main.ts
1 parent cefe198 commit b57b613

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,13 @@ generators.forEach((generator) => {
140140
checkingIfGeneratorExists(attributeValue);
141141
});
142142
});
143+
144+
// closing modal when user clicks outside
145+
document.addEventListener("click", function (event) {
146+
if (event.target === null) return;
147+
const element = <HTMLElement>event.target;
148+
if (element.matches(".modal-container")) {
149+
closeModalFunction();
150+
}
151+
});
152+

0 commit comments

Comments
 (0)