Merge pull request #108 from harris2012/patch-1

fix NoteInfo.jsx for undo
This commit is contained in:
lilit 2024-05-16 07:23:53 +03:00 committed by GitHub
commit 0366bb8ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,7 @@ export default function NoteInfo({ data, nid }) {
setEditField({ content: e.target.value, height: data.height }) setEditField({ content: e.target.value, height: data.height })
} }
onBlur={(e) => { onBlur={(e) => {
if (e.target.value === editField.name) return; if (e.target.value === editField.content) return;
const textarea = document.getElementById(`note_${data.id}`); const textarea = document.getElementById(`note_${data.id}`);
textarea.style.height = "0"; textarea.style.height = "0";
textarea.style.height = textarea.scrollHeight + "px"; textarea.style.height = textarea.scrollHeight + "px";