Focus on Tap at the end of the line
This commit is contained in:
parent
0394211021
commit
b5c7f9cd8a
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue