HomePhabricator
Diffusion Comm 9ada6219b9f1

[native] Add active prop to Search component

Description

[native] Add active prop to Search component

Summary:
In the following diff I create a separate rendering path for the search component in ChatThreadList when it's not active versus when it is active.

I needed a way to detect when the search became active so I could switch from rendering the inline (inactive) TextInput to the fixed (active) one.

I first tried wrapping the inactive TextInput in a TouchableWithoutFeedback that could capture touches, but the TextInput had priority priority.

I then tried just using the TextInput's onFocus, but that caused weird keyboard effects... the keyboard would appear for the inline TextInput, then disappear and reappear for the fixed one.

This diff introduces an active prop, and when it is set to false we will render a Text instead of a `TextInput.

Test Plan: Tested in combination D1083

Reviewers: palys-swm

Subscribers: KatPo, Adrian, atul

Differential Revision: https://phabricator.ashoat.com/D1082

Details

Provenance
ashoatAuthored on May 1 2021, 6:05 AM
Differential Revision
Restricted Differential Revision
Parents
rCOMM3b3fc65b9b78: [native] Fix react-native-screens crash
Branches
Unknown
Tags
Unknown