SpoilerInput: fix ref
This commit is contained in:
parent
f51f2984a5
commit
69157097dd
2 changed files with 5 additions and 3 deletions
|
@ -316,6 +316,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
|
|||
onSuggestionsFetchRequested={onSuggestionsFetchRequested}
|
||||
onSuggestionsClearRequested={onSuggestionsClearRequested}
|
||||
onSuggestionSelected={onSpoilerSuggestionSelected}
|
||||
ref={spoilerTextRef}
|
||||
/>
|
||||
</Stack>
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ interface ISpoilerInput extends Pick<IAutosuggestInput, 'onSuggestionsFetchReque
|
|||
}
|
||||
|
||||
/** Text input for content warning in composer. */
|
||||
const SpoilerInput: React.FC<ISpoilerInput> = ({
|
||||
const SpoilerInput = React.forwardRef<AutosuggestInput, ISpoilerInput>(({
|
||||
composeId,
|
||||
onSuggestionsFetchRequested,
|
||||
onSuggestionsClearRequested,
|
||||
onSuggestionSelected,
|
||||
}) => {
|
||||
}, ref) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
const compose = useCompose(composeId);
|
||||
|
@ -63,6 +63,7 @@ const SpoilerInput: React.FC<ISpoilerInput> = ({
|
|||
searchTokens={[':']}
|
||||
id='cw-spoiler-input'
|
||||
className='rounded-md dark:!bg-transparent !bg-transparent'
|
||||
ref={ref}
|
||||
autoFocus
|
||||
/>
|
||||
|
||||
|
@ -74,6 +75,6 @@ const SpoilerInput: React.FC<ISpoilerInput> = ({
|
|||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
export default SpoilerInput;
|
Loading…
Reference in a new issue