Skip to content

Commit

Permalink
fix: close #8.
Browse files Browse the repository at this point in the history
  • Loading branch information
hidao80 committed Aug 12, 2023
1 parent a75c363 commit 097f829
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ document.addEventListener("DOMContentLoaded", async () => {
// When the entry to the 0th is confirmed, the log entered is imprinted.
$('input').addEventListener('keydown', async function(e) {
if ("Enter" == e.code) {
// Ignore events processed by the IME
if (e.isComposing || e.keyCode === 229) {
return;
}

if (this.value.length == 0) return;
await appendLog(appendTime(this.value));
this.value = '';
Expand All @@ -110,6 +115,10 @@ document.addEventListener("DOMContentLoaded", async () => {
//
$('textarea').addEventListener('keydown', async function(e) {
if ("Enter" == e.code) {
// Ignore events processed by the IME
if (e.isComposing || e.keyCode === 229) {
return;
}
await saveLogs();
}
});
Expand Down

0 comments on commit 097f829

Please sign in to comment.