Skip to content

Commit

Permalink
SmartUrlInput [nfc]: Comment on a partially debugged React Nav bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Mar 29, 2022
1 parent e999399 commit 577ecd6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/SmartUrlInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ export default function SmartUrlInput(props: Props): Node {
useFocusEffect(
useCallback(() => {
if (textInputRef.current) {
// Sometimes the effect of this `.focus()` is immediately undone
// (the keyboard is closed) by a Keyboard.dismiss() from React
// Navigation's internals. Seems like a complex bug, but the symptom
// isn't terrible, it just means that on back-navigating to this
// screen, sometimes the keyboard flicks open then closed, instead
// of just opening. Shrug. See
// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/realm-input/near/1346690
//
// `.current` is not type-checked; see definition.
textInputRef.current.focus();
}
Expand Down

0 comments on commit 577ecd6

Please sign in to comment.