ComposeForm: disable submit when there is no editorRef

This commit is contained in:
Alex Gleason 2023-11-27 15:00:39 -06:00
parent 54dff2131f
commit e426f72130
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -108,7 +108,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
const isEmpty = !(fulltext.trim() || anyMedia);
const condensed = shouldCondense && !isDraggedOver && !composeFocused && isEmpty && !isUploading;
const shouldAutoFocus = autoFocus && !showSearch;
const canSubmit = !isSubmitting && !isUploading && !isChangingUpload && !isEmpty && length(fulltext) <= maxTootChars;
const canSubmit = !!editorRef.current && !isSubmitting && !isUploading && !isChangingUpload && !isEmpty && length(fulltext) <= maxTootChars;
const getClickableArea = () => {
return clickableAreaRef ? clickableAreaRef.current : formRef.current;