Skip to content

Commit 18acc5a

Browse files
committed
Add cancel event on Esc press
1 parent 42a5ff4 commit 18acc5a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/iframe.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ document.addEventListener("DOMContentLoaded", () => {
6262
// @ts-expect-error setValue is defined in the global scope
6363
setValue(typ, value);
6464
}
65+
66+
window.addEventListener("keyup", (e) => {
67+
if (e.key === "Escape") {
68+
window.nlBabyMonitor.onCancel();
69+
}
70+
});
6571
}
6672
});
6773
});

0 commit comments

Comments
 (0)