Fix media description not recognized if programmatically entered

This commit is contained in:
Lim Chee Aun 2024-04-02 17:45:14 +08:00
parent 28882d98d9
commit ff336628f8

View file

@ -1711,6 +1711,9 @@ function MediaAttachment({
onDescriptionChange, onDescriptionChange,
250, 250,
); );
useEffect(() => {
debouncedOnDescriptionChange(description);
}, [description, debouncedOnDescriptionChange]);
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const textareaRef = useRef(null); const textareaRef = useRef(null);
@ -1759,7 +1762,7 @@ function MediaAttachment({
onInput={(e) => { onInput={(e) => {
const { value } = e.target; const { value } = e.target;
setDescription(value); setDescription(value);
debouncedOnDescriptionChange(value); // debouncedOnDescriptionChange(value);
}} }}
></textarea> ></textarea>
)} )}