Focus on Tap at the end of the line

This commit is contained in:
Rafael 2022-02-08 09:39:35 -03:00 committed by Thomas Zarebczan
parent 0394211021
commit b5c7f9cd8a

View file

@ -304,8 +304,11 @@ export default function TextareaWithSuggestions(props: Props) {
if (!autoFocus) return; if (!autoFocus) return;
const inputElement = inputRef && inputRef.current; const inputElement = inputRef && inputRef.current;
if (inputElement) inputElement.focus(); if (inputElement) {
}, [autoFocus, inputRef]); inputElement.focus();
if (messageValue) inputElement.setSelectionRange(messageValue.length, messageValue.length);
}
}, [autoFocus, inputRef, messageValue]);
React.useEffect(() => { React.useEffect(() => {
if (!isMention) return; if (!isMention) return;