From b148ea2a64992c2b573229a08ead2242822210c4 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 11 Feb 2021 11:41:26 +0100 Subject: [HTML5] Editor: ensure canvas focus when switching tabs. --- misc/dist/html/editor.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'misc/dist') diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 70a35b48cf..c2cfd96da5 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'; } -- cgit v1.2.3