From 6a0d9063bace17f9d46405a3a799f566908fc5c7 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Sun, 26 Apr 2020 23:40:02 +0200 Subject: [PATCH] Revert "Prevent the Return key from submitting while composing using an IME" This reverts commit d13f1cf7b8fd52f858c4594a56d3a4e10b89b191. --- .../javascripts/answerbox/comment.coffee | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/assets/javascripts/answerbox/comment.coffee b/app/assets/javascripts/answerbox/comment.coffee index 7c9e5909..4b93cdb2 100644 --- a/app/assets/javascripts/answerbox/comment.coffee +++ b/app/assets/javascripts/answerbox/comment.coffee @@ -13,14 +13,8 @@ $(document).on "click", "button[name=ab-comments]", -> commentBox.slideUp() btn[0].dataset.state = 'hidden' -isComposing = false -compositionHasJustEnded = false $(document).on "keyup", "input[name=ab-comment-new]", (evt) -> - if isComposing or compositionHasJustEnded - compositionHasJustEnded = false - return - input = $(this) aid = input[0].dataset.aId ctr = $("span#ab-comment-charcount-#{aid}") @@ -55,18 +49,6 @@ $(document).on "keyup", "input[name=ab-comment-new]", (evt) -> complete: (jqxhr, status) -> input.removeAttr 'disabled' -# IME Return key handling -$(document).on "compositionstart", "input[name=ab-comment-new]", (evt) -> - isComposing = true - -$(document).on "compositionend", "input[name=ab-comment-new]", (evt) -> - isComposing = false - compositionHasJustEnded = true - -$(document).on "keydown", "input[name=ab-comment-new]", (evt) -> - # 229 is a special keyCode for events processed by an IME - # https://developer.mozilla.org/en-US/docs/Web/API/Document/keyup_event - compositionHasJustEnded = false unless event.which == 229 # character count $(document).on "input", "input[name=ab-comment-new]", (evt) ->