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