removing event loop and using requestAnimationFrame
This commit is contained in:
+3
-4
@@ -1002,11 +1002,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||||||
document.querySelector("#edit-container-panel-name-input").value = identity.name || "";
|
document.querySelector("#edit-container-panel-name-input").value = identity.name || "";
|
||||||
document.querySelector("#edit-container-panel-usercontext-input").value = userContextId || NEW_CONTAINER_ID;
|
document.querySelector("#edit-container-panel-usercontext-input").value = userContextId || NEW_CONTAINER_ID;
|
||||||
const containerName = document.querySelector("#edit-container-panel-name-input");
|
const containerName = document.querySelector("#edit-container-panel-name-input");
|
||||||
setTimeout(function()
|
window.requestAnimationFrame(() => {
|
||||||
{
|
|
||||||
containerName.focus();
|
|
||||||
containerName.select();
|
containerName.select();
|
||||||
}, 0);
|
containerName.focus();
|
||||||
|
});
|
||||||
[...document.querySelectorAll("[name='container-color']")].forEach(colorInput => {
|
[...document.querySelectorAll("[name='container-color']")].forEach(colorInput => {
|
||||||
colorInput.checked = colorInput.value === identity.color;
|
colorInput.checked = colorInput.value === identity.color;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user