Form Editor v2.5 (#599)

* Form Editor v2.5

* Remove log debug

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2024-10-23 14:04:51 +05:30
committed by GitHub
parent 97c4b9db5b
commit 8a1282f4b0
23 changed files with 169 additions and 87 deletions

View File

@@ -15,9 +15,7 @@
v-if="!editing"
:content="content"
>
<label class="cursor-pointer truncate w-full">
{{ content }}
</label>
{{ content }}
</slot>
<div
v-if="editing"
@@ -55,7 +53,11 @@ const divHeight = ref(0)
const parentRef = ref(null) // Ref for parent element
const editInputRef = ref(null) // Ref for edit input element
const startEditing = () => {
const startEditing = (event) => {
if (editing.value || (event.type === 'keydown' && event.target !== parentRef.value)) {
return
}
if (parentRef.value) {
divHeight.value = parentRef.value.offsetHeight
editing.value = true