From ce5f4d3dda775d24c3ebe23894fb3d3460cd1976 Mon Sep 17 00:00:00 2001 From: vfbd Date: Thu, 30 Jun 2022 11:31:54 -0400 Subject: [PATCH] Click on blank part of editor to defocus in Chromium based browsers In Chromium based browsers you can now click the blank part of the editor to submit changes. This is to maintain consistency with the editor behaviour in Firefox which already did this when you clicked on the blank part of the editor. --- static/application.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/application.js b/static/application.js index 5667d80a..235434d7 100644 --- a/static/application.js +++ b/static/application.js @@ -2510,6 +2510,12 @@ $(document).ready(function(){ chunkOnFocusOut ); mutation_observer = new MutationObserver(chunkOnDOMMutate); + $("#gamescreen").on('click', function(e) { + if(this !== e.target) { + return; + } + document.activeElement.blur(); + }); // This is required for the editor to work correctly in Firefox on desktop // because the gods of HTML and JavaScript say so