GoodDAPP icon indicating copy to clipboard operation
GoodDAPP copied to clipboard

Deal with setTimeout hacks to focus an input

Open serdiukov-o-nordwhale opened this issue 4 years ago • 0 comments

On IOS you cant call focus not from a user action. For now, setTimeout hacks are used

But correctly will be when target screen's component will perform auto-focus, as setTimeout solution isn't exact. We can pass additional param via .navigate then check if it was passed in useEffect and perform auto focus

Instead of auto-focusing on IOS we can make an field the first responder https://developer.apple.com/documentation/uikit/uiresponder/1621113-becomefirstresponder It will be auto-focused on first user's interaction

Need to investogate how to call this native method from RN

serdiukov-o-nordwhale avatar Mar 24 '20 09:03 serdiukov-o-nordwhale