/** * @file Conserve le brouillon d'un mémo et ajuste la hauteur de son champ. */ import { useLayoutEffect } from "react"; import { useInlineEdit } from "../../../hooks/useInlineEdit.js"; export function MemoTextEditor({ text, textContent, onCommit }) { const { draft, setDraft, inputRef, commit } = useInlineEdit({ value: text, onCommit, commitUnchanged: true }); useLayoutEffect(() => { const element = inputRef.current; if (!element) return; element.style.height = "auto"; element.style.height = `${element.scrollHeight + 2}px`; }); return (