From f17fe571df857c3580aee2750f278078c9de211c Mon Sep 17 00:00:00 2001 From: Mantary Date: Thu, 28 Jun 2018 16:41:06 +0900 Subject: [PATCH] Use keydown instead of keypress on Firefox (cherry pick from 2be873e3c708) This puts issue: #3383, PR: #3413 (Use keydown instead of keypress on Firefox) directly on top of bacc37cf9b3a, which is the last commit before fe08d2a1db5b merged #3268 (getLineHTMLForExport - Fixes #2486 but breaks plugins). This is necessary for showing that: - bacc37cf9b3a was passing client side tests on firefox Visit `http:///tests/frontend/` using firefox. - 2be873e3c708 forgot to update the client side tests. You cannot test it since that commit was mad on top of other changes, hence this graft - in this commit there are 20 failures with firefox: passes: 82 failures: 20 duration: 261.84s --- src/static/js/ace2_inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 90cefa50..d7ec4326 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3708,8 +3708,8 @@ function Ace2Inner(){ return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice } var specialHandled = false; - var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); - var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome || browser.firefox) ? (type == "keydown") : (type == "keypress")); + var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome || browser.firefox) ? (type == "keydown") : (type == "keypress")); var stopped = false; inCallStackIfNecessary("handleKeyEvent", function()