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';
}