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

The keyboard disappears after each letter is typed or deleted

Open roei133 opened this issue 3 years ago • 1 comments

The keyboard disappears after each letter is typed or deleted and it is not clear why this is happening.

my code example:

<Autocomplete
                data={
                  autoCompleteWaterSourceData?.length === 1 &&
                  autoCompleteWaterSourceData[0]
                    ? []
                    : autoCompleteWaterSourceData
                }
                placeholder={placeholder1}
                value={querySourceCode}
                autoCorrect={false}
                onChangeText={setQuerySourceCode}
                flatListProps={{
                  keyboardShouldPersistTaps: 'always',
                  keyExtractor: (_, idx) => idx.Water_Source_Code,
                  renderItem: ({
                    item: { Water_Source_Code, Water_Source_Name },
                  }) => (
                    <TouchableOpacity
                      onPress={() =>
                        setQuerySourceCode(
                          Water_Source_Code + ' ' + Water_Source_Name
                        )
                      }
                    >
                      <Text style={styles.autoCompleteText}>
                        {Water_Source_Code + ' ' + Water_Source_Name}
                      </Text>
                    </TouchableOpacity>
                  ),
                }}
              />
              ```

roei133 avatar Jul 07 '22 08:07 roei133

The README mentions a known issue with ScrollViews:

By default the autocomplete will not behave as expected inside a <ScrollView />. Set the scroll view's prop to fix this: keyboardShouldPersistTaps={true} for RN <= 0.39, or keyboardShouldPersistTaps='always' for RN >= 0.40. (#5). Alternatively, you can use renderResultList to render a custom result list that does not use FlatList. See the tests for an example.

Perhaps that is causing the issue?

marlonschlosshauer avatar Jul 13 '22 08:07 marlonschlosshauer

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 15 '22 18:10 stale[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Oct 22 '22 20:10 stale[bot]

I counter this error and than resolve but don't know why it comes again any other solution.

keyut-shah avatar Oct 12 '23 13:10 keyut-shah