callstack / callstack/react-native-pager-view

[Real device] TextInput cannot trigger the paste function in ViewPage

Abierto
#278 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

android bug
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.

reportView

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>
  );
};

 2021-01-01 19 07 03

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

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. 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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.