callstack / callstack/react-native-pager-view
[Real device] TextInput cannot trigger the paste function in ViewPage
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.4k
- Forks
- 476
- Merge medio
- 10 d 21 h
- PR fusionados (30 d)
- 2
Descripción
Ask your Question
Thanks for providing such a great library. In the process of using it recently, I found that if TextInput is nested in ViewPage, TextInput cannot trigger the paste function, please see the animation below.

here is my code
import React, { useEffect, useCallback } from 'react';
import { View, Text, TextInput } from 'react-native';
import ViewPager from '@react-native-community/viewpager';
const App = () => {
return (
<View style={{ flex: 1 }}>
<TextInput
placeholder="placeholder"
style={{ borderWidth: 1, borderColor: 'red' }}
/>
<ViewPager style={{ flex: 1 }}>
<View style={{ flex: 1 }}>
<TextInput
placeholder="TextInput in ViewPage"
style={{ borderWidth: 1, borderColor: 'red' }}
/>
</View>
<View style={{ flex: 1, backgroundColor: 'red' }} />
</ViewPager>
</View>
);
};
I accidentally discovered that if the textinput is re-rendered, the paste function is restored.
here is my code
const App = () => {
const [visible, setVisible] = useState(false);
return (
<View style={{ flex: 1 }}>
<TextInput
placeholder="placeholder"
style={{ borderWidth: 1, borderColor: 'red' }}
/>
<ViewPager style={{ flex: 1 }}>
<View style={{ flex: 1 }}>
{visible && (
<TextInput
placeholder="TextInput in ViewPage"
style={{ borderWidth: 1, borderColor: 'red' }}
/>
)}
<Button
title="make TextInput reRender"
onPress={() => {
setVisible(true);
}}
/>
</View>
<View style={{ flex: 1, backgroundColor: 'red' }} />
</ViewPager>
</View>
);
};

I don't know what happened and why the paste function will not work. Is this a bug? Finally, thank you for reading this question during your busy schedule and looking forward to your reply, thank you.
iOS work fine. no try it
Library :
react-native : 0.63.2
@react-native-community/viewpager: ^4.2.2,
device :
device : xiaomi(android10) and huawei
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce el ejemplo con un TextInput anidado en ViewPager en Android 10 utilizando los dispositivos Xiaomi o Huawei indicados, comparando el renderizado inicial con el caso de rerenderizado. Se considera terminado cuando el TextInput anidado puede activar el pegado sin requerir un rerenderizado; en el informe no se nombran archivos fuente ni pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, react-native, typescript
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100