diff --git a/app/soapbox/features/compose/components/compose-form.tsx b/app/soapbox/features/compose/components/compose-form.tsx index f3ac7a5823..92364b7b0f 100644 --- a/app/soapbox/features/compose/components/compose-form.tsx +++ b/app/soapbox/features/compose/components/compose-form.tsx @@ -17,7 +17,7 @@ import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest import AutosuggestTextarea from 'soapbox/components/autosuggest-textarea'; import { Button, HStack, Stack } from 'soapbox/components/ui'; import EmojiPickerDropdown from 'soapbox/features/emoji/containers/emoji-picker-dropdown-container'; -import { useAppDispatch, useAppSelector, useCompose, useFeatures, useInstance, usePrevious } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useCompose, useDraggedFiles, useFeatures, useInstance, usePrevious } from 'soapbox/hooks'; import { isMobile } from 'soapbox/is-mobile'; import QuotedStatusContainer from '../containers/quoted-status-container'; @@ -92,6 +92,8 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab const spoilerTextRef = useRef(null); const autosuggestTextareaRef = useRef(null); + const { isDraggedOver } = useDraggedFiles(formRef); + const handleChange: React.ChangeEventHandler = (e) => { dispatch(changeCompose(id, e.target.value)); }; @@ -236,7 +238,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab ), [features, id]); - const condensed = shouldCondense && !composeFocused && isEmpty() && !isUploading; + const condensed = shouldCondense && !isDraggedOver && !composeFocused && isEmpty() && !isUploading; const disabled = isSubmitting; const countedText = [spoilerText, countableText(text)].join(''); const disabledButton = disabled || isUploading || isChangingUpload || length(countedText) > maxTootChars || (countedText.length !== 0 && countedText.trim().length === 0 && !anyMedia);