mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Focus textarea after a timeout (#15408)
GitOrigin-RevId: 468cc27a6fd0a677858906ee67d872bc0b64529d
This commit is contained in:
parent
3bf468f599
commit
e06f40173d
1 changed files with 4 additions and 2 deletions
|
@ -111,8 +111,10 @@ function AutoExpandingTextArea({
|
|||
resetHeight()
|
||||
if (autoFocus) {
|
||||
const cursorPos = el.value.length
|
||||
el.focus()
|
||||
el.setSelectionRange(cursorPos, cursorPos)
|
||||
window.setTimeout(() => {
|
||||
el.focus()
|
||||
el.setSelectionRange(cursorPos, cursorPos)
|
||||
}, 100)
|
||||
}
|
||||
}, [autoFocus, resetHeight])
|
||||
|
||||
|
|
Loading…
Reference in a new issue