[HTML5] Editor: ensure canvas focus when switching tabs.
This commit is contained in:
4
misc/dist/html/editor.html
vendored
4
misc/dist/html/editor.html
vendored
@ -284,6 +284,10 @@
|
|||||||
tabs.forEach(function (elem) {
|
tabs.forEach(function (elem) {
|
||||||
if (elem.id == 'tab-' + name) {
|
if (elem.id == 'tab-' + name) {
|
||||||
elem.style.display = 'block';
|
elem.style.display = 'block';
|
||||||
|
if (name == 'editor' || name == 'game') {
|
||||||
|
const canvas = document.getElementById(name + '-canvas');
|
||||||
|
canvas.focus();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
elem.style.display = 'none';
|
elem.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user