fix: parse hashtags only when collapsing entry card
Move tag parsing from textarea blur to entry collapse action. This prevents incomplete tags from being created while editing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,9 +128,11 @@
|
||||
debouncedSave();
|
||||
}
|
||||
|
||||
function toggleExpand() {
|
||||
async function toggleExpand() {
|
||||
if (expanded) {
|
||||
// Collapsing - reset edit state to current entry values
|
||||
// Collapsing - parse hashtags from content
|
||||
await handleParseTags();
|
||||
// Reset edit state to current entry values
|
||||
editTitle = entry.title || '';
|
||||
editContent = entry.content;
|
||||
editType = entry.type;
|
||||
@@ -207,8 +209,8 @@
|
||||
input.value = '';
|
||||
}
|
||||
|
||||
async function handleContentBlur() {
|
||||
// Parse hashtags from content when focus leaves the textarea
|
||||
async function handleParseTags() {
|
||||
// Parse hashtags from content
|
||||
const formData = new FormData();
|
||||
formData.append('id', entry.id);
|
||||
|
||||
@@ -426,7 +428,6 @@
|
||||
id="edit-content-{entry.id}"
|
||||
bind:value={editContent}
|
||||
oninput={handleInput}
|
||||
onblur={handleContentBlur}
|
||||
rows="4"
|
||||
class="w-full px-3 py-2 border border-gray-200 rounded-lg text-base resize-y focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
></textarea>
|
||||
|
||||
Reference in New Issue
Block a user