diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html
index 70a35b48cf3..c2cfd96da5b 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';
}