fix: stabilize handleContentChange callback via ref to prevent NoteEditor re-render stealing focus

This commit is contained in:
Hermes
2026-08-01 12:53:19 +00:00
parent 445f5e1257
commit ee57195681
2 changed files with 24 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
import sys
with open(sys.argv[1], 'r') as f:
content = f.read()
old = '<input\n key={selectedNote?.id || \'none\'}\n defaultValue={selectedNote?.title || \'\'}\n onBlur={(e) => {'
new = '<input\n key={selectedNote?.id || \'none\'}\n defaultValue={selectedNote?.title || \'\'}\n onMouseDown={(e) => e.stopPropagation()}\n onBlur={(e) => {'
content = content.replace(old, new, 1)
with open(sys.argv[1], 'w') as f:
f.write(content)
print('Done')