From 5abe08f484e94860f0aa168fef93453f2b61cdcc Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 11 Feb 2021 11:41:26 +0100 Subject: [PATCH] [HTML5] Editor: ensure canvas focus when switching tabs. (cherry picked from commit b148ea2a64992c2b573229a08ead2242822210c4) --- misc/dist/html/editor.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 589b16bc7e2..881f7cd6e64 100644 --- a/misc/dist/html/editor.html +++ b/misc/dist/html/editor.html @@ -284,6 +284,10 @@ tabs.forEach(function (elem) { if (elem.id == 'tab-' + name) { elem.style.display = 'block'; + if (name == 'editor' || name == 'game') { + const canvas = document.getElementById(name + '-canvas'); + canvas.focus(); + } } else { elem.style.display = 'none'; }