fix NoteInfo.jsx for undo

This commit is contained in:
Harris Zhang 2024-05-15 17:40:51 +08:00 committed by GitHub
parent 30886ac48f
commit fb17307a79
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";