wip fix component

This commit is contained in:
Rizky 2023-12-18 21:39:39 +07:00
parent 53eefed895
commit 1c1ea7767d
2 changed files with 10 additions and 2 deletions

View File

@ -46,14 +46,15 @@ export const EdCompPicker = () => {
if (
item.type === "item" &&
item.component?.id &&
active_meta.parent?.id
active_meta.parent?.id &&
item.component?.id !== active.comp_id
) {
active_meta = getMetaById(p, active_meta.parent.id);
if (active_meta) {
item = active_meta.item;
} else {
alert("Failed to add component!");
alert("Warning: Please edit component first before adding. ");
return;
}
}

View File

@ -28,6 +28,11 @@ export const mainPerItemVisit = (
if ((meta.item as IContent).type === "text" && !meta.item.adv?.jsBuilt) {
parts.props.spellCheck = false;
parts.props.contentEditable = true;
if (meta.parent?.comp_id) {
if (meta.parent.comp_id !== active.comp_id) {
parts.props.contentEditable = false;
}
}
parts.props.onBlur = (e) => {
text_edit.prevent_select_all = false;
@ -104,6 +109,8 @@ export const mainPerItemVisit = (
is_active && "el-active",
is_active &&
css`
outline: none;
&::after {
content: " ";
pointer-events: none;