wip fix rename component

This commit is contained in:
Rizky 2024-01-29 10:42:22 +07:00
parent 67f11cbbb0
commit 284fedc5c4
1 changed files with 21 additions and 12 deletions

View File

@ -85,6 +85,14 @@ export const EdTreeName = ({
onKeyDown={(e) => {
e.stopPropagation();
if (e.key === "Enter" || e.key === "Escape") {
if (item.component?.id) {
if (!confirm("Rename component?")) {
p.ui.tree.rename_id = "";
p.render();
return;
}
}
setTimeout(() => {
if (e.key === "Escape") {
local.rename = item.name;
} else {
@ -99,6 +107,7 @@ export const EdTreeName = ({
) as HTMLInputElement;
if (el) el.focus();
});
}, 50);
}
}}
onChange={(e) => {