diff options
| author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-02-11 11:41:26 +0100 |
|---|---|---|
| committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-02-11 13:10:18 +0100 |
| commit | b148ea2a64992c2b573229a08ead2242822210c4 (patch) | |
| tree | 1816a3e6265ee62819ce340ae6f5ae4f941646ac | |
| parent | dca3ce441aac377dd23c6d45a00574fb731c9b35 (diff) | |
| download | redot-engine-b148ea2a64992c2b573229a08ead2242822210c4.tar.gz | |
[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'; } |
