Skip to content

Commit 1494bc8

Browse files
author
katiegoines
committed
fix error in modal close
1 parent eeef8e8 commit 1494bc8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/ApiDocs/display/ApiModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export const ApiModal = ({
9494

9595
if (typeof window != 'undefined') {
9696
window.onclick = function (event) {
97-
if (event.target.className.includes('api-modal-container--open')) {
97+
if (
98+
event.target.classList &&
99+
event.target.classList.contains('api-modal-container--open')
100+
) {
98101
closeModal();
99102
}
100103
};

0 commit comments

Comments
 (0)