You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On mobile we primarily did this to workaround certain bugs. Most of these bugs have been resolved by now since we switched to using the new arch and used native-stack for navigation.
In fact, in this PR we removed the manual .focus() call and instead rely on the autoFocus prop and we haven't seen any issues so far:
However, we've kept the shouldDelayFocus prop for now and still manually call focus if shouldDelayFocus is true.
This ticket is a follow up to remove shouldDelayFocus.
This also brings the UX improvement that the keyboard will open promptly. See this recording on iOS where shouldDelayFocus was removed and only autoFocus={true} is set:
Before
After (✨ Faster ✨)
ios_before.MP4
ios_after.MP4
There are a few considerations for removing this prop:
1) On android there is a bug with the search router where the input won't get focused if we only rely on autoFocus={true}. On iOS it's working. We need to investigate what native part is broken to make this work on android as well:
android_bug.mp4
2) The prop seems to be used to also help with smoothing the label animations for inputs, we might need to fine tune this as well (to make the animation smooth even when there is no delay)
3) We might want to see if this can be removed on web as well
In our
TextInputcomponent instead of using theautoFocusprop we manually calltextInputRef.focus():App/src/components/TextInput/BaseTextInput/index.native.tsx
Lines 109 to 123 in 41c38e3
On mobile we primarily did this to workaround certain bugs. Most of these bugs have been resolved by now since we switched to using the new arch and used native-stack for navigation.
In fact, in this PR we removed the manual
.focus()call and instead rely on theautoFocusprop and we haven't seen any issues so far:However, we've kept the
shouldDelayFocusprop for now and still manually call focus ifshouldDelayFocusistrue.This ticket is a follow up to remove
shouldDelayFocus.This also brings the UX improvement that the keyboard will open promptly. See this recording on iOS where
shouldDelayFocuswas removed and onlyautoFocus={true}is set:ios_before.MP4
ios_after.MP4
There are a few considerations for removing this prop:
1) On android there is a bug with the search router where the input won't get focused if we only rely on
autoFocus={true}. On iOS it's working. We need to investigate what native part is broken to make this work on android as well:android_bug.mp4
2) The prop seems to be used to also help with smoothing the label animations for inputs, we might need to fine tune this as well (to make the animation smooth even when there is no delay)
3) We might want to see if this can be removed on web as well
Note: This would fix the following issues:
Issue Owner
Current Issue Owner: @trjExpensify