Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The keyboard disappears after each letter is typed or deleted #240

Closed
roei133 opened this issue Jul 7, 2022 · 4 comments
Closed

The keyboard disappears after each letter is typed or deleted #240

roei133 opened this issue Jul 7, 2022 · 4 comments
Labels

Comments

@roei133
Copy link

roei133 commented Jul 7, 2022

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>
                  ),
                }}
              />
              ```
@marlonschlosshauer
Copy link

The README mentions a known issue with ScrollViews:

By default the autocomplete will not behave as expected inside a . 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?

@stale
Copy link

stale bot commented Oct 15, 2022

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 stale bot added the Stale label Oct 15, 2022
@stale
Copy link

stale bot commented Oct 22, 2022

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 stale bot closed this as completed Oct 22, 2022
@keyut-shah
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants