summaryrefslogtreecommitdiff
path: root/misc/dist/html
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-02-11 11:41:26 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-02-11 13:10:18 +0100
commitb148ea2a64992c2b573229a08ead2242822210c4 (patch)
tree1816a3e6265ee62819ce340ae6f5ae4f941646ac /misc/dist/html
parentdca3ce441aac377dd23c6d45a00574fb731c9b35 (diff)
[HTML5] Editor: ensure canvas focus when switching tabs.
Diffstat (limited to 'misc/dist/html')
-rw-r--r--misc/dist/html/editor.html4
1 files changed, 4 insertions, 0 deletions
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';
}