From 9c37259d44b1ba4d2e10c7cae93a3b1c3a51885f Mon Sep 17 00:00:00 2001 From: Belem Zhang Date: Fri, 21 Jun 2024 13:40:53 +0800 Subject: [PATCH] [NNotepad] Fix #253 e.target.close is not a function error (#254) * [NNotepad] Fix #253 e.target.close is not a function error * check dialog for e.target directly --- nnotepad/js/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/nnotepad/js/index.js b/nnotepad/js/index.js index dbc7c77e..25ae06de 100644 --- a/nnotepad/js/index.js +++ b/nnotepad/js/index.js @@ -74,6 +74,7 @@ document.addEventListener('DOMContentLoaded', async (e) => { ); $$('dialog').forEach((dialog) => { dialog.addEventListener('click', (e) => { + if (e.target !== dialog) return; const rect = e.target.getBoundingClientRect(); if ( e.clientY < rect.top ||