[HTML5] Editor: ensure canvas focus when switching tabs.

(cherry picked from commit b148ea2a64)
This commit is contained in:
Fabio Alessandrelli 2021-02-11 11:41:26 +01:00 committed by Rémi Verschelde
parent adb93d7120
commit 5abe08f484
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

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