Fixes text on mobile (iOS)

This commit is contained in:
Steve Ruiz 2021-06-18 14:55:36 +01:00
parent eccf5f6307
commit 5f71f5c38b
4 changed files with 21 additions and 5 deletions

View file

@ -27,7 +27,11 @@ function Shape({ id, isSelecting, parentPoint }: ShapeProps) {
useEffect(() => {
if (isEditing) {
setTimeout(() => rFocusable.current?.focus(), 0)
setTimeout(() => {
const elm = rFocusable.current
if (!elm) return
elm.focus()
}, 0)
}
}, [isEditing])