react-native icon indicating copy to clipboard operation
react-native copied to clipboard

iOS KeyboardAvoidingView weird behaviour with TextInput double tap

Open BeeMargarida opened this issue 4 years ago • 1 comments

Description

In iOS, when using KeyboardAvoidingView with behaviour height, after the first appearance of the keyboard by focusing on the input, when clicking in the input, the keyboard appears above the input, but the focus is not lost.

Observations:

  1. Only happens if a letter is written and then the tap is made on the input.
  2. The onBlur is not called
  3. If calling the input focus on onPressIn, the problem remains, since the focus was not lost.
  4. After the problematic behaviour happens, if we continue to write on the keyboard, the text is written, since the focus was not lost on the input.

Things tested:

  1. Encapsulating the TextView with a ScrollView: same problem
  2. Try without SafeAreaView: same problem

Also tested in physical device, the problem remains.

React Native version:

0.64.1

Steps To Reproduce

Something like:

<SafeAreaView style={{ flex: 1, paddingBottom: 0 }}>
       <KeyboardAvoidingView
               behavior={Platform.OS === "ios" ? "height" : undefined}
               style={{ flex: 1, justifyContent: "flex-end", backgroundColor: "green" }}
       >
         <TextInput style={{ backgroundColor: "red" }} />
       </KeyboardAvoidingView>
</SafeAreaView>

Expected Results

The input should maintain its position, since its focus was not lost.

Snack, code example, screenshot, or link to a repository:

In this snack I also got a problem, but not actually the same: https://snack.expo.io/bSvTUfBK7 (i'm not sure it was using the same react-native version)

- -
The problematic behaviour The problematic behaviour only occuring when tapping after writing a letter after the first focus
react-native-bug react-native-bug-2

BeeMargarida avatar Jun 01 '21 15:06 BeeMargarida

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 04 '24 05:02 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Feb 11 '24 05:02 github-actions[bot]