mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Focus textarea after a timeout (#15408)
GitOrigin-RevId: 468cc27a6fd0a677858906ee67d872bc0b64529d
This commit is contained in:
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user