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