callstack / callstack/react-native-pager-view

setPage prevents Keyboard on Android

Open
#514 6 comments 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.4k
Forks
476
Avg merge
10d 21h
Merged PRs (30d)
2

Description

## Environment

"expo": "~44.0.0",
"react": "17.0.1",
"react-native": "0.64.3",
"react-native-pager-view": "5.4.9",

OS: Ubuntu 20.04
Device OS: Android 11

## Description

setPage prevents initial keyboard open on any PagerView child View except for the first and last.

In my testing, this only occurs on Android and only when the keyboard is not on screen when setPage is called. It does not occur when setPageWithoutAnimation is called or when a page is selected by gesture rather than calling setPage.

## Reproducible Demo

[Snack reproducing bug](https://snack.expo.dev/@aar2222/rn-pager-view-bug-android)

[Repo reproducing bug](https://github.com/adam-adair/rn-pager-view-bug-android)

To reproduce the bug, on an Android device:
- press buttons to navigate to second or third child Views.
- focus the TextInput. Keyboard will dismiss immediately. It can be opened with a second focus.
- The bug doesn't appear if the keyboard is on screen when the button is pressed or if the TextInput is on the first or last child View.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.