diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-02-11 13:16:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 13:16:40 +0100 |
commit | b9863e157e3329d4a74f4c3c738ddd414cb28799 (patch) | |
tree | 0120d7e0041bc42ca4c4078ef81530589b521651 | |
parent | b8fab45ddb5df9d060f74776ac961b04f3862889 (diff) | |
parent | b148ea2a64992c2b573229a08ead2242822210c4 (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.html | 4 |
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'; } |