summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-02-11 13:16:40 +0100
committerGitHub <noreply@github.com>2021-02-11 13:16:40 +0100
commitb9863e157e3329d4a74f4c3c738ddd414cb28799 (patch)
tree0120d7e0041bc42ca4c4078ef81530589b521651
parentb8fab45ddb5df9d060f74776ac961b04f3862889 (diff)
parentb148ea2a64992c2b573229a08ead2242822210c4 (diff)
Merge pull request #45891 from Faless/js/4.x_editor_focus
[HTML5] Editor: ensure canvas focus when switching tabs.
-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';
}