refac/fix: title generation button issue

This commit is contained in:
Timothy Jaeryang Baek
2025-07-22 17:31:01 +04:00
parent 8bc7d85eac
commit d21a2581a6
2 changed files with 20 additions and 4 deletions
+8 -1
View File
@@ -126,6 +126,7 @@
let showDeleteConfirm = false;
let showAccessControlModal = false;
let ignoreBlur = false;
let titleInputFocused = false;
let titleGenerating = false;
@@ -970,7 +971,8 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
}}
on:blur={(e) => {
// check if target is generate button
if (e.relatedTarget?.id === 'generate-title-button') {
if (ignoreBlur) {
ignoreBlur = false;
return;
}
@@ -987,6 +989,11 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
<button
class=" self-center dark:hover:text-white transition"
id="generate-title-button"
disabled={(note?.user_id !== $user?.id && $user?.role !== 'admin') ||
titleGenerating}
on:mouseenter={() => {
ignoreBlur = true;
}}
on:click={(e) => {
e.preventDefault();
e.stopImmediatePropagation();