HomePhabricator
Diffusion Comm 756c3519bb41

[native] Fix onBlur occurring on every tap

Description

[native] Fix onBlur occurring on every tap

Summary:
Ever since we introduced the CommunityDrawerNavigator, we've had an issue where any tap will trigger a TextInput onBlur

In ENG-8326, I investigated this issue in the context of ChatThreadListSearch's clear button causing a keyboard dismissal. I investigated by iteratively disabling parts of the application, including the navigation stack. That helped me identify that CommunityDrawerNavigator is responsible.

Once I figured that out, I was able to restore the old behavior by introducing keyboardDismissMode: 'none'. This also seems to address ENG-8325.

Now that the keyboard is not handled directly by the navigator, I added some code to TabNavigator to make sure we dismiss the keyboard when the drawer is focused. While this isn't as ideal as @react-navigation/stack's keyboard manager (which dismisses the keyboard when a gesture is started, and can refocus the keyboard if the gesture is abandoned), using that behavior isn't possible here because @react-navigation/drawer doesn't expose a way for us to know when a gesture begins or is cancelled.

Test Plan: I tested and confirmed both ENG-8326 and ENG-8325 are resolved on my local iOS simulator

Reviewers: inka, tomek

Reviewed By: inka

Differential Revision: https://phab.comm.dev/D12276

Details

Provenance
ashoatAuthored on Jun 3 2024, 4:30 AM
Reviewer
inka
Differential Revision
D12276: [native] Fix onBlur occurring on every tap
Parents
rCOMM84b0a9a27658: [native] Animate CalendarInputBar using Reanimated layout animation
Branches
Unknown
Tags
Unknown