use textarea for editing the source

This commit is contained in:
froehlichA 2023-03-18 19:26:50 +01:00
parent 7c78d2a787
commit f3cbf967fd

View file

@ -94,13 +94,13 @@
{/if}
</div>
<div class="description" on:click={enterEditMode}>
<span
<textarea
class="textarea"
bind:this={descriptionEditEl}
hidden={!editMode}
contenteditable="true"
data-placeholder="Write your story..."
bind:textContent={state.description}
></span>
placeholder="Write your story..."
bind:value={state.description}
></textarea>
<span
class="avatar-plugin--md-preview"
hidden={editMode}
@ -148,6 +148,11 @@
border-radius: 6px;
}
.textarea {
width: 100%;
height: 100%;
}
[contenteditable=true]:empty:not(:focus):before{
content: attr(data-placeholder);
color: var(--text-faint);